HHH-4118 warn if hibernate.hbm2ddl.auto has unrecognized value

This commit is contained in:
Brett Meyer 2013-10-02 15:46:07 -04:00
parent 85bb1e1146
commit fdcfeca511
1 changed files with 6 additions and 3 deletions

View File

@ -351,16 +351,19 @@ public class SettingsFactory implements Serializable {
if ( "validate".equals(autoSchemaExport) ) { if ( "validate".equals(autoSchemaExport) ) {
settings.setAutoValidateSchema( true ); settings.setAutoValidateSchema( true );
} }
if ( "update".equals(autoSchemaExport) ) { else if ( "update".equals(autoSchemaExport) ) {
settings.setAutoUpdateSchema( true ); settings.setAutoUpdateSchema( true );
} }
if ( "create".equals(autoSchemaExport) ) { else if ( "create".equals(autoSchemaExport) ) {
settings.setAutoCreateSchema( true ); settings.setAutoCreateSchema( true );
} }
if ( "create-drop".equals( autoSchemaExport ) ) { else if ( "create-drop".equals( autoSchemaExport ) ) {
settings.setAutoCreateSchema( true ); settings.setAutoCreateSchema( true );
settings.setAutoDropSchema( true ); settings.setAutoDropSchema( true );
} }
else if ( !StringHelper.isEmpty( autoSchemaExport ) ) {
LOG.warn( "Unrecognized value for \"hibernate.hbm2ddl.auto\": " + autoSchemaExport );
}
settings.setImportFiles( properties.getProperty( AvailableSettings.HBM2DDL_IMPORT_FILES ) ); settings.setImportFiles( properties.getProperty( AvailableSettings.HBM2DDL_IMPORT_FILES ) );
EntityMode defaultEntityMode = EntityMode.parse( properties.getProperty( AvailableSettings.DEFAULT_ENTITY_MODE ) ); EntityMode defaultEntityMode = EntityMode.parse( properties.getProperty( AvailableSettings.DEFAULT_ENTITY_MODE ) );