From 6be091038d70073bbc6308bfc84f01a5e0e93853 Mon Sep 17 00:00:00 2001 From: Vlad Mihalcea Date: Fri, 25 Jan 2019 09:35:08 +0200 Subject: [PATCH] HHH-13230 - The AvailableSettings.HBM2DDL_HALT_ON_ERROR setting does not accept String values --- .../tool/schema/spi/SchemaManagementToolCoordinator.java | 3 ++- .../test/schemagen/SchemaScriptFileGenerationFailureTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/spi/SchemaManagementToolCoordinator.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/spi/SchemaManagementToolCoordinator.java index 84fd16fa0d..f05f9a8dce 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/spi/SchemaManagementToolCoordinator.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/spi/SchemaManagementToolCoordinator.java @@ -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, diff --git a/hibernate-core/src/test/java/org/hibernate/jpa/test/schemagen/SchemaScriptFileGenerationFailureTest.java b/hibernate-core/src/test/java/org/hibernate/jpa/test/schemagen/SchemaScriptFileGenerationFailureTest.java index e7f4e6a103..e08c873dab 100644 --- a/hibernate-core/src/test/java/org/hibernate/jpa/test/schemagen/SchemaScriptFileGenerationFailureTest.java +++ b/hibernate-core/src/test/java/org/hibernate/jpa/test/schemagen/SchemaScriptFileGenerationFailureTest.java @@ -104,7 +104,7 @@ public class SchemaScriptFileGenerationFailureTest { final Map 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 classes = new ArrayList<>(); classes.addAll( Arrays.asList( new Class[] { TestEntity.class } ) );