HHH-13230 - The AvailableSettings.HBM2DDL_HALT_ON_ERROR setting does not accept String values

This commit is contained in:
Vlad Mihalcea 2019-01-25 09:35:08 +02:00
parent ab4c270fac
commit 6be091038d
2 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import org.hibernate.boot.Metadata;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.engine.config.spi.ConfigurationService;
import org.hibernate.engine.config.spi.StandardConverters;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.tool.schema.Action;
import org.hibernate.tool.schema.SourceType;
@ -60,7 +61,7 @@ public class SchemaManagementToolCoordinator {
final SchemaManagementTool tool = serviceRegistry.getService( SchemaManagementTool.class );
final ConfigurationService configService = serviceRegistry.getService( ConfigurationService.class );
boolean haltOnError = configService.getSetting( AvailableSettings.HBM2DDL_HALT_ON_ERROR, Boolean.class, false);
boolean haltOnError = configService.getSetting( AvailableSettings.HBM2DDL_HALT_ON_ERROR, StandardConverters.BOOLEAN, false);
final ExecutionOptions executionOptions = buildExecutionOptions(
configurationValues,

View File

@ -104,7 +104,7 @@ public class SchemaScriptFileGenerationFailureTest {
final Map<Object, Object> config = Environment.getProperties();
config.put( org.hibernate.cfg.AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, writer );
config.put( org.hibernate.cfg.AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" );
config.put( AvailableSettings.HBM2DDL_HALT_ON_ERROR, true );
config.put( AvailableSettings.HBM2DDL_HALT_ON_ERROR, "true" );
ArrayList<Class> classes = new ArrayList<>();
classes.addAll( Arrays.asList( new Class[] { TestEntity.class } ) );