private void validateHibernateProperties ( final GuiceConfig configuration , final Properties hibernateProperties ) { final boolean allowCreateSchema = configuration . getBoolean ( GuiceProperties . HIBERNATE_ALLOW_HBM2DDL_CREATE , false ) ; if ( ! allowCreateSchema ) { // Check that hbm2ddl is not set to a prohibited value, throwing an exception if it is final String hbm2ddl = hibernateProperties . getProperty ( "hibernate.hbm2ddl.auto" ) ; if ( hbm2ddl != null && ( hbm2ddl . equalsIgnoreCase ( "create" ) || hbm2ddl . equalsIgnoreCase ( "create-drop" ) ) ) { throw new IllegalArgumentException ( "Value '" + hbm2ddl + "' is not permitted for hibernate property 'hibernate.hbm2ddl.auto' under the current configuration, consider using 'update' instead. If you must use the value 'create' then set configuration parameter '" + GuiceProperties . HIBERNATE_ALLOW_HBM2DDL_CREATE + "' to 'true'" ) ; } } }
Checks whether hbm2ddl is set to a prohibited value throwing an exception if it is