Reputation: 7802
I am looking at the Hibernate hbm2ddl.auto
configuration property and its possible values:
validate
update
create
create-drop
What do all these values do?
The Hibernate Reference Documentation only talks briefly about create-drop
, but doesn't say anything about the other values:
hibernate.hbm2ddl.auto
Automatically validates or exports schema DDL to the database when the
SessionFactory
is created. Withcreate-drop
, the database schema will be dropped when theSessionFactory
is closed explicitly.e.g.
validate
|update
|create
|create-drop
I found very useful explanations in these Stack Overflow questions:
But still nothing in the official documentation.
Upvotes: 54
Views: 107257
Reputation: 1966
The documentation has been updated to include this information. Here is a link to the official, current documentation for this feature.
hibernate.hbm2ddl.auto (e.g. none (default value), create-only, drop, create, create-drop, validate, and update)
Setting to perform SchemaManagementTool actions automatically as part of the SessionFactory lifecycle. Valid options are defined by the externalHbm2ddlName value of the Action enum:
none No action will be performed. create-only Database creation will be generated. drop Database dropping will be generated. create Database dropping will be generated followed by database creation. create-drop Drop the schema and recreate it on SessionFactory startup. Additionally, drop the schema on SessionFactory shutdown. validate Validate the database schema update Update the database schema
Upvotes: 4
Reputation: 3367
For hbm2ddl.auto
property the list of possible options is:
Upvotes: 77
Reputation: 908
The link you provided is already the official documentation. So, there's nothing more official and comprehensive as-of today.
So I guess the answer to your question is two-fold:
I know this isn't the perfect answer you dreamt about, but this is actually all you have today.
But the good news is that the project is open-source, so you have all you need to help improve it :-).
Upvotes: 12