From efd45288d9cd4239858ab1a7baf62a1088b2b95f Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Mon, 16 Sep 2024 15:17:15 -0500 Subject: [PATCH] HHH-18337 - SequenceStyleGenerator not respecting physical naming strategy --- .../orm/test/id/enhanced/SequenceStyleConfigUnitTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/id/enhanced/SequenceStyleConfigUnitTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/id/enhanced/SequenceStyleConfigUnitTest.java index a0b32f685ea9..34c39525ec05 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/id/enhanced/SequenceStyleConfigUnitTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/id/enhanced/SequenceStyleConfigUnitTest.java @@ -126,8 +126,11 @@ public void testDefaultedTableBackedConfiguration() { () -> buildingContext.getBootstrapContext().getTypeConfiguration(), serviceRegistry ); + Database database = new Database( buildingContext.getBuildingOptions() ); + GeneratorCreationContextImpl generatorCreationContext = new GeneratorCreationContextImpl( database ); Properties props = buildGeneratorPropertiesBase( buildingContext ); SequenceStyleGenerator generator = new SequenceStyleGenerator(); + generator.create( generatorCreationContext ); generator.configure( new TypeConfiguration().getBasicTypeRegistry() .resolve( StandardBasicTypes.LONG ), @@ -135,7 +138,6 @@ public void testDefaultedTableBackedConfiguration() { serviceRegistry ); - Database database = new Database( buildingContext.getBuildingOptions() ); generator.registerExportables( database ); generator.initialize( SqlStringGenerationContextImpl.forTests( database.getJdbcEnvironment() ) ); @@ -276,17 +278,19 @@ public void testForceTableUse() { () -> buildingContext.getBootstrapContext().getTypeConfiguration(), serviceRegistry ); + Database database = new Database( buildingContext.getBuildingOptions() ); + GeneratorCreationContextImpl generatorCreationContext = new GeneratorCreationContextImpl( database ); Properties props = buildGeneratorPropertiesBase( buildingContext ); props.setProperty( SequenceStyleGenerator.FORCE_TBL_PARAM, "true" ); SequenceStyleGenerator generator = new SequenceStyleGenerator(); + generator.create( generatorCreationContext ); generator.configure( new TypeConfiguration().getBasicTypeRegistry() .resolve( StandardBasicTypes.LONG ), props, serviceRegistry ); - Database database = new Database( buildingContext.getBuildingOptions() ); generator.registerExportables( database ); generator.initialize( SqlStringGenerationContextImpl.forTests( database.getJdbcEnvironment() ) );