• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Not able to view the data persisted in the database.

 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
A tiny monkey bit me and I got tiny ads:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic