This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to view the data persisted in the database.

 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I started working on a sample and simple hibernate application, that will persist "Person" objects and have few questions regarding this. I'm listing out the questions below:

Please find the following components








Q 1) When I run my client any time, I see only 5 objects being persisted? Why? Every time it runs, my assumption is,it should persist 5 objects and thus increasing the total count of persisted objects. I get the same thing, even I use a completely new session while retrieving "Person"s from the database.

Q 2) After every run, I'm trying to look into hsqldb (this is database used) but I do not see any table being created by name "PERSON". Am I looking at the right spot?

Q 3) If I remove "hibernate.hbm2ddl.auto" from configuration file, and run the client I get that table does not exist. I can understand this, because I did not find any table (see question 2). But why the table is not created.

Q 4) If I create a table PERSON explicitly and remove "hibernate.hbm2ddl.auto" from configuration file, and run the client, I get can not insert NULL into ID. Why is hibernate trying to insert null at first place for ID field.

Q 5) If I want to use a composite key, what do I need to modify?

Could you please look into this and advice ?

Thanks
Kumar
 
Kumar Raja
Ranch Hand
Posts: 547
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could some one please look into my request and advice why the objects are not really persisted in the database, outside the program execution ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic