• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

configuration of hibernate in xml

 
Gajendra Kangokar
Ranch Hand
Posts: 94
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
 
Emil Jennings
Ranch Hand
Posts: 75
1
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic