Knowledge Walls
John Peter
Pune, Maharashtra, India
How to use hibernate.hbm2ddl.auto property in Hibernate?
38547 Views
Hibernate.hbm2ddl.auto 
hibernate.hbm2ddl.auto is automatically validates and exports DDL to schema when the sessionFactory is created.

By default, It is not doing any creation or modification automatically on db. If user sets below values then it is doing DDL  schema changes automatically.

create - doing creating schema
update - updating existing schema
validate - validate existing schema
create-drop - create and drop the schema automatically when session is starts and ends.
How to use hibernate.hbm2ddl.auto property
# validate
<entry key="hibernate.hbm2ddl.auto" value="validate" />

# update
<entry key="hibernate.hbm2ddl.auto" value="update" />

# create
<entry key="hibernate.hbm2ddl.auto" value="create" />

# create-drop
<entry key="hibernate.hbm2ddl.auto" value="create-drop" />
Best Lessons of "One day One Thing to Know"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details