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.
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.