From 335e46894338b99a70352dedf42c0402ca23567b Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Tue, 7 Mar 2023 14:58:35 +0000 Subject: [PATCH] HHH-16223 Deprecate HBM2DDL_DATABASE_ACTION --- .../org/hibernate/cfg/AvailableSettings.java | 14 ++------------ .../OneToOneJoinTableUniquenessTest.java | 2 +- .../toone/EagerToOneWithJoinFetchModeTests.java | 2 +- .../EagerToOneWithSelectFetchModeTests.java | 2 +- .../toone/LazyToOneWithJoinFetchModeTests.java | 2 +- .../toone/LazyToOneWithSelectFetchModeTests.java | 2 +- .../jpa/joinable/ManyToOneJoinTableTest.java | 2 +- .../jpa/jointable/ManyToOneJoinTableTest.java | 2 +- .../jpa/schemagen/JpaSchemaGeneratorTest.java | 16 ++++++++-------- .../SchemaDatabaseFileGenerationFailureTest.java | 2 +- .../test/loading/multiLoad/MultiLoadTest.java | 2 +- .../onetomany/OneToManyBidirectionalTest.java | 2 +- .../SchemaMigrationTargetScriptCreationTest.java | 2 +- .../orm/test/tenantid/TenantIdTest.java | 9 ++++++--- .../orm/test/tenantlongid/TenantLongIdTest.java | 4 ++-- .../orm/test/tenantuuid/TenantUuidTest.java | 9 ++++++--- .../tools/OrderSequenceGenerationTest.java | 2 +- .../orm/test/jcache/RefreshUpdatedDataTest.java | 2 +- .../hibernate/orm/test/jcache/TestHelper.java | 2 +- .../orm/junit/EntityManagerFactoryExtension.java | 4 ++-- .../testing/schema/SchemaCreateHelper.java | 6 +++--- .../testing/schema/SchemaDropHelper.java | 4 ++-- .../testing/schema/SchemaUpdateHelper.java | 2 +- .../hibernate/tool/hbm2ddl/SchemaExportTask.java | 2 +- 24 files changed, 47 insertions(+), 51 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 30a1ddac1f..2552779c5b 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java @@ -1639,20 +1639,10 @@ public interface AvailableSettings { String HBM2DDL_CONNECTION = "javax.persistence.schema-generation-connection"; /** - * Specifies whether schema generation commands for schema creation are to be determined based - * on object/relational mapping metadata, DDL scripts, or a combination of the two. See - * {@link org.hibernate.tool.schema.SourceType} for the list of legal values. - *

- * If no value is specified, a default is inferred as follows: - *

- * + * @deprecated Migrate to {@link #JAKARTA_HBM2DDL_CREATE_SOURCE} instead * @see org.hibernate.tool.schema.SourceType */ + @Deprecated String HBM2DDL_CREATE_SOURCE = "javax.persistence.schema-generation.create-source"; /** diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/onetoone/OneToOneJoinTableUniquenessTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/onetoone/OneToOneJoinTableUniquenessTest.java index 5af70f93fb..2db37c739a 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/onetoone/OneToOneJoinTableUniquenessTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/onetoone/OneToOneJoinTableUniquenessTest.java @@ -62,7 +62,7 @@ public class OneToOneJoinTableUniquenessTest extends BaseCoreFunctionalTestCase String value = output.toPath().toString(); configuration.setProperty( AvailableSettings.HBM2DDL_SCRIPTS_CREATE_TARGET, value ); configuration.setProperty( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "create" ); - configuration.setProperty( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" ); + configuration.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); configuration.setProperty( AvailableSettings.FORMAT_SQL, "false" ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/EagerToOneWithJoinFetchModeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/EagerToOneWithJoinFetchModeTests.java index 522956bf61..3a3f1b0c6f 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/EagerToOneWithJoinFetchModeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/EagerToOneWithJoinFetchModeTests.java @@ -49,7 +49,7 @@ import static org.hamcrest.MatcherAssert.assertThat; @SessionFactory(useCollectingStatementInspector = true) @ServiceRegistry( settings = { - @Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) public class EagerToOneWithJoinFetchModeTests { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/EagerToOneWithSelectFetchModeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/EagerToOneWithSelectFetchModeTests.java index a391fca005..db8e80b878 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/EagerToOneWithSelectFetchModeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/EagerToOneWithSelectFetchModeTests.java @@ -46,7 +46,7 @@ import static org.hamcrest.MatcherAssert.assertThat; @SessionFactory(useCollectingStatementInspector = true) @ServiceRegistry( settings = { - @Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) public class EagerToOneWithSelectFetchModeTests { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/LazyToOneWithJoinFetchModeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/LazyToOneWithJoinFetchModeTests.java index 4cb62e0c60..7833bc29ac 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/LazyToOneWithJoinFetchModeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/LazyToOneWithJoinFetchModeTests.java @@ -47,7 +47,7 @@ import static org.hamcrest.MatcherAssert.assertThat; @SessionFactory(useCollectingStatementInspector = true) @ServiceRegistry( settings = { - @Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) public class LazyToOneWithJoinFetchModeTests { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/LazyToOneWithSelectFetchModeTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/LazyToOneWithSelectFetchModeTests.java index 08c3d70a75..bea6ab56db 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/LazyToOneWithSelectFetchModeTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/fetchmode/toone/LazyToOneWithSelectFetchModeTests.java @@ -47,7 +47,7 @@ import static org.hibernate.testing.hamcrest.CollectionMatchers.hasSize; @SessionFactory(useCollectingStatementInspector = true) @ServiceRegistry( settings = { - @Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) public class LazyToOneWithSelectFetchModeTests { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/joinable/ManyToOneJoinTableTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/joinable/ManyToOneJoinTableTest.java index fa71108a3d..29629fb997 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/joinable/ManyToOneJoinTableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/joinable/ManyToOneJoinTableTest.java @@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test; ) @ServiceRegistry( settings = { - @Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) @SessionFactory diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jointable/ManyToOneJoinTableTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jointable/ManyToOneJoinTableTest.java index 747b0a3d23..9d4bbf1656 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jointable/ManyToOneJoinTableTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/jointable/ManyToOneJoinTableTest.java @@ -37,7 +37,7 @@ import static org.junit.Assert.assertThat; ) @ServiceRegistry( settings = { - @Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) @SessionFactory diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/JpaSchemaGeneratorTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/JpaSchemaGeneratorTest.java index 9151a0f691..29e53af068 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/JpaSchemaGeneratorTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/JpaSchemaGeneratorTest.java @@ -49,7 +49,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT @TestForIssue(jiraKey = "HHH-8271") public void testSqlLoadScriptSourceClasspath() { Map settings = buildSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); settings.put( AvailableSettings.HBM2DDL_LOAD_SCRIPT_SOURCE, getLoadSqlScript() ); doTest( settings ); } @@ -59,7 +59,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT @TestForIssue(jiraKey = "HHH-8271") public void testSqlLoadScriptSourceUrl() { Map settings = buildSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); settings.put( AvailableSettings.HBM2DDL_LOAD_SCRIPT_SOURCE, getResourceUrlString( getLoadSqlScript() ) ); doTest( settings ); } @@ -68,8 +68,8 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT @TestForIssue(jiraKey = "HHH-8271") public void testSqlCreateScriptSourceClasspath() { Map settings = buildSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" ); - settings.put( AvailableSettings.HBM2DDL_CREATE_SOURCE, "metadata-then-script" ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_CREATE_SOURCE, "metadata-then-script" ); settings.put( AvailableSettings.HBM2DDL_CREATE_SCRIPT_SOURCE, getCreateSqlScript() ); doTest( settings ); } @@ -78,8 +78,8 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT @TestForIssue(jiraKey = "HHH-8271") public void testSqlCreateScriptSourceUrl() { Map settings = buildSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" ); - settings.put( AvailableSettings.HBM2DDL_CREATE_SOURCE, "metadata-then-script" ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_CREATE_SOURCE, "metadata-then-script" ); settings.put( AvailableSettings.HBM2DDL_CREATE_SCRIPT_SOURCE, getResourceUrlString( getCreateSqlScript() ) ); doTest( settings ); } @@ -90,7 +90,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT public void testSqlDropScriptSourceClasspath() { Map settings = buildSettings(); settings.put( AvailableSettings.HBM2DDL_DROP_SOURCE, "metadata-then-script" ); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "drop" ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "drop" ); settings.put( AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getDropSqlScript() ); doTest( settings ); } @@ -100,7 +100,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT public void testSqlDropScriptSourceUrl() { Map settings = buildSettings(); settings.put( AvailableSettings.HBM2DDL_DROP_SOURCE, "metadata-then-script" ); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "drop" ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "drop" ); settings.put( AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getResourceUrlString( getDropSqlScript() ) ); doTest( settings ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaDatabaseFileGenerationFailureTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaDatabaseFileGenerationFailureTest.java index 052cfc54e5..a38cdfcf67 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaDatabaseFileGenerationFailureTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/schemagen/SchemaDatabaseFileGenerationFailureTest.java @@ -119,7 +119,7 @@ public class SchemaDatabaseFileGenerationFailureTest { private Map getConfig() { final Map config = Environment.getProperties(); config.put( AvailableSettings.HBM2DDL_CONNECTION, connection ); - config.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "drop" ); + config.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "drop" ); config.put( AvailableSettings.HBM2DDL_HALT_ON_ERROR, true ); ArrayList classes = new ArrayList<>(); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/MultiLoadTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/MultiLoadTest.java index a5838ec636..096f8b9e88 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/MultiLoadTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/loading/multiLoad/MultiLoadTest.java @@ -54,7 +54,7 @@ import static org.junit.Assert.assertTrue; settings = { @Setting( name = AvailableSettings.USE_SECOND_LEVEL_CACHE, value = "true" ), @Setting( name = AvailableSettings.GENERATE_STATISTICS, value = "true" ), - @Setting( name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop" ) + @Setting( name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop" ) } ) @DomainModel( diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/onetomany/OneToManyBidirectionalTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/onetomany/OneToManyBidirectionalTest.java index cb9b93acbe..26cef8c9ff 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/onetomany/OneToManyBidirectionalTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/onetomany/OneToManyBidirectionalTest.java @@ -51,7 +51,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @ServiceRegistry( settings = { @Setting(name = AvailableSettings.GENERATE_STATISTICS, value = "true"), - @Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) public class OneToManyBidirectionalTest { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/SchemaMigrationTargetScriptCreationTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/SchemaMigrationTargetScriptCreationTest.java index 0a2e5cf456..d9bfaf854b 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/SchemaMigrationTargetScriptCreationTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/schemaupdate/SchemaMigrationTargetScriptCreationTest.java @@ -60,7 +60,7 @@ public class SchemaMigrationTargetScriptCreationTest extends BaseCoreFunctionalT fail( e.getMessage() ); } output.deleteOnExit(); - configuration.setProperty( Environment.HBM2DDL_DATABASE_ACTION, "update" ); + configuration.setProperty( Environment.JAKARTA_HBM2DDL_DATABASE_ACTION, "update" ); configuration.setProperty( Environment.HBM2DDL_SCRIPTS_ACTION, "update" ); configuration.setProperty( Environment.HBM2DDL_SCRIPTS_CREATE_TARGET, output.getAbsolutePath() ); } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantid/TenantIdTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantid/TenantIdTest.java index 7ecf44e2ee..60bf5daaa0 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantid/TenantIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantid/TenantIdTest.java @@ -25,15 +25,18 @@ import org.hibernate.testing.orm.junit.SkipForDialect; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import static org.hibernate.cfg.AvailableSettings.HBM2DDL_DATABASE_ACTION; -import static org.junit.jupiter.api.Assertions.*; +import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; @SessionFactory @DomainModel(annotatedClasses = { Account.class, Client.class, Record.class }) @ServiceRegistry( settings = { - @Setting(name = HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) public class TenantIdTest implements SessionFactoryProducer { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantlongid/TenantLongIdTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantlongid/TenantLongIdTest.java index 300d4b9676..4444661f28 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantlongid/TenantLongIdTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantlongid/TenantLongIdTest.java @@ -21,14 +21,14 @@ import org.hibernate.binder.internal.TenantIdBinder; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import static org.hibernate.cfg.AvailableSettings.HBM2DDL_DATABASE_ACTION; +import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION; import static org.junit.jupiter.api.Assertions.*; @SessionFactory @DomainModel(annotatedClasses = { Account.class, Client.class }) @ServiceRegistry( settings = { - @Setting(name = HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) public class TenantLongIdTest implements SessionFactoryProducer { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantuuid/TenantUuidTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantuuid/TenantUuidTest.java index 26606ba401..ce90e72d77 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/tenantuuid/TenantUuidTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/tenantuuid/TenantUuidTest.java @@ -23,14 +23,17 @@ import org.junit.jupiter.api.Test; import java.util.UUID; -import static org.hibernate.cfg.AvailableSettings.HBM2DDL_DATABASE_ACTION; -import static org.junit.jupiter.api.Assertions.*; +import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; @SessionFactory @DomainModel(annotatedClasses = { Account.class, Client.class }) @ServiceRegistry( settings = { - @Setting(name = HBM2DDL_DATABASE_ACTION, value = "create-drop") + @Setting(name = JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop") } ) public class TenantUuidTest implements SessionFactoryProducer { 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 ccd05a24f1..d2fbac3bfd 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 @@ -57,7 +57,7 @@ public class OrderSequenceGenerationTest extends BaseEnversJPAFunctionalTestCase options.put( AvailableSettings.HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() ); options.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); options.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" ); - options.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" ); + options.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); options.put( AvailableSettings.HBM2DDL_AUTO, "create-drop" ); } diff --git a/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/RefreshUpdatedDataTest.java b/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/RefreshUpdatedDataTest.java index 2d6d1e2b59..768af2229c 100644 --- a/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/RefreshUpdatedDataTest.java +++ b/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/RefreshUpdatedDataTest.java @@ -65,7 +65,7 @@ public class RefreshUpdatedDataTest { serviceRegistry = ssrb .configure( "hibernate-config/hibernate.cfg.xml" ) - .applySetting( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP ) + .applySetting( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP ) .build(); final MetadataSources metadataSources = new MetadataSources( serviceRegistry ); diff --git a/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/TestHelper.java b/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/TestHelper.java index dffcad0a0b..991abcd457 100644 --- a/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/TestHelper.java +++ b/hibernate-jcache/src/test/java/org/hibernate/orm/test/jcache/TestHelper.java @@ -119,7 +119,7 @@ public class TestHelper { final StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder() .configure( "hibernate-config/hibernate.cfg.xml" ) .applySetting( AvailableSettings.GENERATE_STATISTICS, "true" ) - .applySetting( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP ) + .applySetting( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP ) .applySetting( AvailableSettings.HBM2DDL_AUTO, "create-drop" ); if ( H2Dialect.class.equals( DialectContext.getDialect().getClass() ) ) { diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/EntityManagerFactoryExtension.java b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/EntityManagerFactoryExtension.java index 54a7d37e31..ddb99d0078 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/EntityManagerFactoryExtension.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/orm/junit/EntityManagerFactoryExtension.java @@ -118,7 +118,7 @@ public class EntityManagerFactoryExtension if ( emfAnn.exportSchema() ) { pui.getProperties().setProperty( - AvailableSettings.HBM2DDL_DATABASE_ACTION, + AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP.getExternalHbm2ddlName() ); } @@ -251,7 +251,7 @@ public class EntityManagerFactoryExtension } final HashMap settings = new HashMap<>( baseProperties ); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP ); final StandardServiceRegistry serviceRegistry = model.getMetadataBuildingOptions().getServiceRegistry(); diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaCreateHelper.java b/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaCreateHelper.java index af93a12970..4502ad28ed 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaCreateHelper.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaCreateHelper.java @@ -35,7 +35,7 @@ public class SchemaCreateHelper { public static void create(Metadata metadata, ServiceRegistry serviceRegistry) { final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE ); SchemaManagementToolCoordinator.process( metadata, serviceRegistry, @@ -46,7 +46,7 @@ public class SchemaCreateHelper { public static void createOnly(Metadata metadata, ServiceRegistry serviceRegistry) { final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE_ONLY ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_ONLY ); SchemaManagementToolCoordinator.process( metadata, serviceRegistry, @@ -60,7 +60,7 @@ public class SchemaCreateHelper { StandardServiceRegistry serviceRegistry, Connection connection) { final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE ); settings.put( AvailableSettings.HBM2DDL_CONNECTION, connection ); SchemaManagementToolCoordinator.process( metadata, diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaDropHelper.java b/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaDropHelper.java index 8d238896c7..d6b7163d20 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaDropHelper.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaDropHelper.java @@ -32,7 +32,7 @@ public class SchemaDropHelper { public static void drop(Metadata metadata, ServiceRegistry serviceRegistry) { final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.DROP ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.DROP ); SchemaManagementToolCoordinator.process( metadata, serviceRegistry, @@ -46,7 +46,7 @@ public class SchemaDropHelper { StandardServiceRegistry serviceRegistry, Connection connection) { final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.DROP ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.DROP ); settings.put( AvailableSettings.HBM2DDL_CONNECTION, connection ); SchemaManagementToolCoordinator.process( metadata, diff --git a/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaUpdateHelper.java b/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaUpdateHelper.java index ec0ba839b2..a482da1054 100644 --- a/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaUpdateHelper.java +++ b/hibernate-testing/src/main/java/org/hibernate/testing/schema/SchemaUpdateHelper.java @@ -30,7 +30,7 @@ public class SchemaUpdateHelper { public static void update(Metadata metadata, ServiceRegistry serviceRegistry) { final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings(); - settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.UPDATE ); + settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.UPDATE ); SchemaManagementToolCoordinator.process( metadata, serviceRegistry, diff --git a/tooling/hibernate-ant/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExportTask.java b/tooling/hibernate-ant/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExportTask.java index 075596ca12..f5238bcc6e 100644 --- a/tooling/hibernate-ant/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExportTask.java +++ b/tooling/hibernate-ant/src/main/java/org/hibernate/tool/hbm2ddl/SchemaExportTask.java @@ -243,7 +243,7 @@ public class SchemaExportTask extends MatchingTask { } if ( output.doExport() ) { - ssrBuilder.applySetting( AvailableSettings.HBM2DDL_DATABASE_ACTION, exportType.getAction() ); + ssrBuilder.applySetting( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, exportType.getAction() ); }