aspose file tools
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
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply 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: 457

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: 457

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Not able to view the data persisted in the database.
 
Similar Threads
Session onject throwing exception when trying to save a object or begin a transaction
java.lang.NoClassDefFoundError
First Hibernate Test Application Errors out
org.hibernate.exception.GenericJDBCException
Hibernate - Query Issues With Many-To-One Relationships