• 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

configuration of hibernate in xml

 
Ranch Hand
Posts: 94
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Hi,

above is my xml configuration using JPA hibernate I have mapped my Entity class as well (Employee),
whenever I start hibernate, Employee table is newly created and i loose all data from the table which was stored last time.

I have also commented this line <!-- <property name="hbm2ddl.auto">create</property> -->.
please someome tell me where i am gone wrong,what is the solution.

Thank you
Gajendra
 
Ranch Hand
Posts: 75
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The configuration property hibernate.hbm2ddl.auto has four values:

validate: validate the schema, makes no changes to the database.
update: update the schema. Be very careful (read avoid) using update in production.
create: creates the schema, destroying previous data.
create-drop: drop the schema at the end of the session.
 
reply
    Bookmark Topic Watch Topic
  • New Topic