Skip to content

Commit efd4528

Browse files
committed
HHH-18337 - SequenceStyleGenerator not respecting physical naming strategy
1 parent 744732b commit efd4528

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/id/enhanced/SequenceStyleConfigUnitTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,18 @@ public void testDefaultedTableBackedConfiguration() {
126126
() -> buildingContext.getBootstrapContext().getTypeConfiguration(),
127127
serviceRegistry
128128
);
129+
Database database = new Database( buildingContext.getBuildingOptions() );
130+
GeneratorCreationContextImpl generatorCreationContext = new GeneratorCreationContextImpl( database );
129131
Properties props = buildGeneratorPropertiesBase( buildingContext );
130132
SequenceStyleGenerator generator = new SequenceStyleGenerator();
133+
generator.create( generatorCreationContext );
131134
generator.configure(
132135
new TypeConfiguration().getBasicTypeRegistry()
133136
.resolve( StandardBasicTypes.LONG ),
134137
props,
135138
serviceRegistry
136139
);
137140

138-
Database database = new Database( buildingContext.getBuildingOptions() );
139141
generator.registerExportables( database );
140142
generator.initialize( SqlStringGenerationContextImpl.forTests( database.getJdbcEnvironment() ) );
141143

@@ -276,17 +278,19 @@ public void testForceTableUse() {
276278
() -> buildingContext.getBootstrapContext().getTypeConfiguration(),
277279
serviceRegistry
278280
);
281+
Database database = new Database( buildingContext.getBuildingOptions() );
282+
GeneratorCreationContextImpl generatorCreationContext = new GeneratorCreationContextImpl( database );
279283
Properties props = buildGeneratorPropertiesBase( buildingContext );
280284
props.setProperty( SequenceStyleGenerator.FORCE_TBL_PARAM, "true" );
281285

282286
SequenceStyleGenerator generator = new SequenceStyleGenerator();
287+
generator.create( generatorCreationContext );
283288
generator.configure(
284289
new TypeConfiguration().getBasicTypeRegistry()
285290
.resolve( StandardBasicTypes.LONG ),
286291
props,
287292
serviceRegistry
288293
);
289-
Database database = new Database( buildingContext.getBuildingOptions() );
290294
generator.registerExportables( database );
291295
generator.initialize( SqlStringGenerationContextImpl.forTests( database.getJdbcEnvironment() ) );
292296

0 commit comments

Comments
 (0)