Annotation Interface GeneratorType


@Retention(RUNTIME) @Target({FIELD,METHOD}) @Deprecated(since="6.0") public @interface GeneratorType
Deprecated.
ValueGenerationType and AnnotationValueGeneration now provide a much more powerful and typesafe alternative
Marks a field or property of an entity as automatically generated by code written in Java, before any SQL statement to insert or update the entity is executed, specifying an implementation of ValueGenerator used for generating its values.

It is the responsibility of the client to ensure that a specified generator type produces values which are assignable to the annotated property.

This annotation is only useful for values generated in the Java code, and it is not used for generating the values of entity identifiers:

  • For identifier generators, use GenericGenerator or IdGeneratorType.
  • If the value of a field or property is generated by the database when an insert or update statement is executed, use the Generated annotation.
Author:
Gunnar Morling
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<? extends ValueGenerator<?>>
    Deprecated.
    A class that implements ValueGenerator, which will be called to generate values of the annotated field or property.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Deprecated.
    Specifies when values should be generated: If GenerationTime.INSERT, the value will be generated before each SQL insert statement is executed.
  • Element Details

    • when

      Deprecated.
      Specifies when values should be generated:
      Default:
      ALWAYS