88import org .hibernate .generator .BeforeExecutionGenerator ;
99import org .hibernate .generator .EventType ;
1010import org .hibernate .generator .Generator ;
11+ import org .hibernate .generator .GeneratorCreationContext ;
1112import org .hibernate .generator .OnExecutionGenerator ;
1213import org .hibernate .id .Configurable ;
1314import org .hibernate .id .PostInsertIdentityPersister ;
1415import org .hibernate .id .factory .IdentifierGeneratorFactory ;
1516import org .hibernate .id .factory .spi .CustomIdGeneratorCreationContext ;
1617import org .hibernate .id .insert .InsertGeneratedIdentifierDelegate ;
18+ import org .hibernate .mapping .PersistentClass ;
19+ import org .hibernate .mapping .Property ;
1720import org .hibernate .service .ServiceRegistry ;
1821import org .hibernate .type .Type ;
1922
@@ -26,10 +29,12 @@ public class NativeGenerator
2629
2730 private final IdentifierGeneratorFactory factory ;
2831 private final String strategy ;
32+ private final CustomIdGeneratorCreationContext creationContext ;
2933
3034 private Generator generator ;
3135
3236 public NativeGenerator (NativeId nativeId , Member member , CustomIdGeneratorCreationContext creationContext ) {
37+ this .creationContext = creationContext ;
3338 factory = creationContext .getIdentifierGeneratorFactory ();
3439 strategy = creationContext .getDatabase ().getDialect ().getNativeIdentifierGeneratorStrategy ();
3540 if ( "identity" .equals (strategy ) ) {
@@ -49,7 +54,12 @@ public boolean generatedOnExecution() {
4954
5055 @ Override
5156 public void configure (Type type , Properties parameters , ServiceRegistry serviceRegistry ) {
52- generator = factory .createIdentifierGenerator (strategy , type , parameters );
57+ generator = factory .createIdentifierGenerator (
58+ strategy ,
59+ type ,
60+ creationContext ,
61+ parameters
62+ );
5363 //TODO: should use this instead of the deprecated method, but see HHH-18135
5464// GenerationType generationType;
5565// switch (strategy) {
0 commit comments