From f7d383320b4a06ab6dd249008e4b3939117f85f5 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Tue, 7 Mar 2023 15:11:05 +0000 Subject: [PATCH] HHH-16223 Deprecate HBM2DDL_SCRIPTS_DROP_TARGET --- .../main/java/org/hibernate/cfg/AvailableSettings.java | 9 ++------- .../qualfiedTableNaming/DefaultCatalogAndSchemaTest.java | 2 +- ...chemaCreateDropUtf8WithoutHbm2DdlCharsetNameTest.java | 4 ++-- .../schemagen/SchemaScriptFileGenerationFailureTest.java | 2 +- .../jpa/schemagen/SchemaScriptFileGenerationTest.java | 2 +- .../test/schemaupdate/SchemaDropToOutputScriptTest.java | 2 +- .../integration/tools/OrderSequenceGenerationTest.java | 2 +- 7 files changed, 9 insertions(+), 14 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java index 9f03c9be91..0bbdb585a2 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java @@ -1683,14 +1683,9 @@ public interface AvailableSettings { String HBM2DDL_SCRIPTS_CREATE_APPEND = "hibernate.hbm2ddl.schema-generation.script.append"; /** - * For cases where the {@value #HBM2DDL_SCRIPTS_ACTION} value indicates that schema drop commands - * should be written to DDL script file, {@value #HBM2DDL_SCRIPTS_DROP_TARGET} specifies either a - * {@link java.io.Writer} configured for output of the DDL script or a string specifying the file - * URL for the DDL script. - * - * @see #HBM2DDL_SCRIPTS_ACTION + * @deprecated Migrate to {@link #JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET} */ - @SuppressWarnings("JavaDoc") + @Deprecated String HBM2DDL_SCRIPTS_DROP_TARGET = "javax.persistence.schema-generation.scripts.drop-target"; /** diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/boot/database/qualfiedTableNaming/DefaultCatalogAndSchemaTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/boot/database/qualfiedTableNaming/DefaultCatalogAndSchemaTest.java index 71cc2b8fb5..9d894852f2 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/boot/database/qualfiedTableNaming/DefaultCatalogAndSchemaTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/boot/database/qualfiedTableNaming/DefaultCatalogAndSchemaTest.java @@ -690,7 +690,7 @@ public class DefaultCatalogAndSchemaTest { StringWriter writer = new StringWriter(); settings.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, action ); settings.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, writer ); - settings.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, writer ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, writer ); SchemaManagementToolCoordinator.process( metadata, serviceRegistry, settings, DelayedDropRegistryNotAvailableImpl.INSTANCE ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaCreateDropUtf8WithoutHbm2DdlCharsetNameTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaCreateDropUtf8WithoutHbm2DdlCharsetNameTest.java index 86485569e5..0b171179d0 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaCreateDropUtf8WithoutHbm2DdlCharsetNameTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaCreateDropUtf8WithoutHbm2DdlCharsetNameTest.java @@ -29,8 +29,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.hibernate.cfg.AvailableSettings.HBM2DDL_SCRIPTS_ACTION; -import static org.hibernate.cfg.AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET; import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET; +import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET; import static org.junit.jupiter.api.Assertions.assertTrue; /** @@ -46,7 +46,7 @@ public class SchemaCreateDropUtf8WithoutHbm2DdlCharsetNameTest { protected Map getConfig() { final Map config = Environment.getProperties(); config.put( JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() ); - config.put( HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); + config.put( JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); config.put( HBM2DDL_SCRIPTS_ACTION, "drop-and-create" ); ArrayList classes = new ArrayList(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaScriptFileGenerationFailureTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaScriptFileGenerationFailureTest.java index a327e87148..4290e7304e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaScriptFileGenerationFailureTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaScriptFileGenerationFailureTest.java @@ -110,7 +110,7 @@ public class SchemaScriptFileGenerationFailureTest { private Map getConfig() { final Map config = Environment.getProperties(); - config.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, writer ); + config.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, writer ); config.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" ); config.put( AvailableSettings.HBM2DDL_HALT_ON_ERROR, "true" ); ArrayList classes = new ArrayList<>(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaScriptFileGenerationTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaScriptFileGenerationTest.java index 0f31860086..5b892d3e44 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaScriptFileGenerationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaScriptFileGenerationTest.java @@ -109,7 +109,7 @@ public class SchemaScriptFileGenerationTest { private Map getConfig() { final Map config = Environment.getProperties(); config.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() ); - config.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); + config.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); config.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" ); ArrayList classes = new ArrayList(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/SchemaDropToOutputScriptTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/SchemaDropToOutputScriptTest.java index 1a92581092..4dea797ef8 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/SchemaDropToOutputScriptTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/SchemaDropToOutputScriptTest.java @@ -77,7 +77,7 @@ public class SchemaDropToOutputScriptTest { final StandardServiceRegistryBuilder standardServiceRegistryBuilder = new StandardServiceRegistryBuilder() .applySetting( Environment.FORMAT_SQL, "false" ) .applySetting( Environment.HBM2DDL_SCRIPTS_ACTION, "drop" ) - .applySetting( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, output.getAbsolutePath() ); + .applySetting( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, output.getAbsolutePath() ); if ( append != null ) { standardServiceRegistryBuilder.applySetting( AvailableSettings.HBM2DDL_SCRIPTS_CREATE_APPEND, append ); diff --git a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/tools/OrderSequenceGenerationTest.java b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/tools/OrderSequenceGenerationTest.java index 8b33301a9d..fc1a786634 100644 --- a/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/tools/OrderSequenceGenerationTest.java +++ b/hibernate-envers/src/test/java/org/hibernate/orm/test/envers/integration/tools/OrderSequenceGenerationTest.java @@ -55,7 +55,7 @@ public class OrderSequenceGenerationTest extends BaseEnversJPAFunctionalTestCase protected void addConfigOptions(Map options) { super.addConfigOptions( options ); options.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() ); - options.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); + options.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); options.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" ); options.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); options.put( AvailableSettings.HBM2DDL_AUTO, "create-drop" );