• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

'hbm2ddl.auto' option in hibernate

 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would like to know what is 'hbm2ddl.auto' option in hibernate. Where and how and why to use it. When we set it to update. Any ideas, resources, links, sample code highly appreciated. thanks in advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its used if you want Hibernate to produce and run DDL.
 
Abubacker Siddik
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Hibernate.hbm2ddl.auto is a property which you can set in hibernate configuration. This will run DDL for the Database. The values for this property are
validate | update | create | create-drop


Validate = will validate the schema that you have, and makes no changes to the database.
Update = will update the database if the schema is already there in the database.
Create = will create new database, removing existing schema if any
Create-drop = will create new database and drops it when the sessionFactory is destroyed.



Abu.A
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic