Annotation Type ValueGenerationType


  • @Target(ANNOTATION_TYPE)
    @Retention(RUNTIME)
    public @interface ValueGenerationType
    Marks an annotation type as a generator annotation type.

    Adding a generator annotation to an entity property causes the value of the property to be generated upon insert or update of the owning entity. Not more than one generator annotation may be placed on a given property.

    Each generator annotation type is associated with a AnnotationValueGeneration which implements the strategy for generating the value. Generator annotation types may define arbitrary custom attributes, e.g. allowing the client to configure the generation timing (if applicable) or other settings taking an effect on the value generation. The corresponding implementation can retrieve these settings from the annotation instance passed to AnnotationValueGeneration.initialize(java.lang.annotation.Annotation, Class).

    Custom generator annotation types must have retention policy RetentionPolicy.RUNTIME.

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.Class<? extends AnnotationValueGeneration<?>> generatedBy
      The type of value generation associated with the annotated value generator annotation type.
    • Element Detail

      • generatedBy

        java.lang.Class<? extends AnnotationValueGeneration<?>> generatedBy
        The type of value generation associated with the annotated value generator annotation type. The referenced generation type must be parameterized with the type of the given generator annotation.
        Returns:
        the value generation type