hibernate.hbm2ddl.auto
create | update | validate |
create-drop
|
|
create |
create the schema, the data previously present (if there) in the schema is lost |
update |
update the schema with the given values. |
validate |
validate the schema. It makes no change in the DB. |
create-drop |
create the schema with destroying the data previously present(if there). It also drop the database schema when the SessionFactory is closed. |
- In case of update, if schema is not present in the DB then the schema is created.
- In case of validate, if schema does not exists in DB, it is not created.
- Instead, it will throw an error:- Table not found:<table name>
- In case of create-drop, schema is not dropped on closing the session. It drops only on closing the SessionFactory.
- In case if i give any value to this property (say abc, instead of above four values discussed above) or it is just left blank. It shows following behavior:
- -If schema is not present in the DB:- It creates the schema
- -If schema is present in the DB:- update the schema.