Annotation Type IdGeneratorType


  • @Target(ANNOTATION_TYPE)
    @Retention(RUNTIME)
    public @interface IdGeneratorType
    Meta-annotation used to mark another annotation as providing configuration for a custom identifier generator. This is the best way to work with customized identifier generation in Hibernate.

    For example, if we have a custom identifier generator:

    
     public class CustomSequenceGenerator implements BeforeExecutionGenerator {
         public CustomSequenceGenerator(CustomSequence config, Member annotatedMember,
                                        CustomIdGeneratorCreationContext context) {
             ...
         }
         ...
     }
     
    Then we may also define an annotation which associates this generator with an entity and supplies configuration parameters:
    {@code
    Since:
    6.0
    See Also:
    Generator, AnnotationBasedGenerator
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Class<? extends Generator> value
      A class which implements Generator.