wood burning stoves*
The moose likes Object Relational Mapping and the fly likes Not able to view the data persisted in the database. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Not able to view the data persisted in the database." Watch "Not able to view the data persisted in the database." New topic
Author

Not able to view the data persisted in the database.

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 519
    
    2

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


Regards
KumarRaja

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 519
    
    2

Could some one please look into my request and advice why the objects are not really persisted in the database, outside the program execution ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not able to view the data persisted in the database.