Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about example in Hibernate Made Easy book - CrudRunner.retrieve()

 
Cassy Thomas
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never Mind!!! I had copied a hibernate.cfg.xml from the Hibernate distribution and the configuration file had the property hibernate.hbm2dll.auto set to create-drop. I commented out this property and it worked.

***************************************************

Hello, I'm working through the examples in the book, "Hibernate Made Easy". I'm having some odd behavior with the example.

Essentially, I have two simple classes outlined below. One is an Annotated Entity class and the other is a simply example that will allow you to create a User record and retrieve it. The create works, however the retrieve is deleting all the records from the corresponding table. I know the code in the book uses Hibernate 3.5, but I didn't think it would be this much of a difference. Can anyone help me understand why? I commented the line that is causing the problem in the second class below. I used debug through Eclipse to find out which statement was deleting all the records.

Many thanks,

This is my persisted object.


This is the example class that executes attempts to create a copy of my object in the MySql database and retrieve it for display.



I am using Hibernate 3.6.Final
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic