• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic