HHH-10657 Make 'none' a valid option for hibernate.hbm2ddl.auto

This commit is contained in:
Sanne Grinovero 2016-03-29 16:39:20 +01:00
parent 68298bbc45
commit 86b49a0ce7
1 changed files with 7 additions and 3 deletions

View File

@ -31,7 +31,11 @@ public enum SchemaAutoTooling {
/**
* Validate the schema on SessionFactory startup.
*/
VALIDATE( "validate" );
VALIDATE( "validate" ),
/**
* Do not attempt to update nor validate the schema.
*/
NONE( "none" );
private final String externalForm;
@ -40,7 +44,7 @@ public enum SchemaAutoTooling {
}
public static SchemaAutoTooling interpret(String configurationValue) {
if ( StringHelper.isEmpty( configurationValue ) ) {
if ( StringHelper.isEmpty( configurationValue ) || NONE.externalForm.equals( configurationValue ) ) {
return null;
}
else if ( VALIDATE.externalForm.equals( configurationValue ) ) {
@ -58,7 +62,7 @@ public enum SchemaAutoTooling {
else {
throw new HibernateException(
"Unrecognized hbm2ddl_auto value : " + configurationValue
+ ". Supported values include create, create-drop, update, and validate."
+ ". Supported values include 'create', 'create-drop', 'update', 'none' and 'validate'."
);
}
}