diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java index e4e645053c..5e3f70a814 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java @@ -3338,9 +3338,13 @@ public final class AnnotationBinder { TableGenerators tableGenerators = annElt.getAnnotation( TableGenerators.class ); if ( tableGenerators != null ) { for ( TableGenerator tableGenerator : tableGenerators.value() ) { + IdentifierGeneratorDefinition idGenerator = buildIdGenerator( + tableGenerator, + context + ); generators.put( - buildIdGenerator( tableGenerator, context ).getName(), - buildIdGenerator( tableGenerator, context ) + idGenerator.getName(), + idGenerator ); } } @@ -3348,9 +3352,13 @@ public final class AnnotationBinder { SequenceGenerators sequenceGenerators = annElt.getAnnotation( SequenceGenerators.class ); if ( sequenceGenerators != null ) { for ( SequenceGenerator sequenceGenerator : sequenceGenerators.value() ) { + IdentifierGeneratorDefinition idGenerator = buildIdGenerator( + sequenceGenerator, + context + ); generators.put( - buildIdGenerator( sequenceGenerator, context ).getName(), - buildIdGenerator( sequenceGenerator, context ) + idGenerator.getName(), + idGenerator ); } }