Annotation Type GeneratorType


  • @Retention(RUNTIME)
    @Target({FIELD,METHOD})
    public @interface GeneratorType
    Marks a property as generated, specifying the ValueGenerator type to be used for generating the value. It is the responsibility of the client to ensure that a generator type is specified which matches the data type of the annotated property.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.Class<? extends ValueGenerator<?>> type
      The value generator type
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      GenerationTime when
      When to generate the value, either only during insert or during insert and update of the hosting entity.
    • Element Detail

      • type

        java.lang.Class<? extends ValueGenerator<?>> type
        The value generator type
        Returns:
        the value generator type
      • when

        GenerationTime when
        When to generate the value, either only during insert or during insert and update of the hosting entity.
        Returns:
        the time of generation
        Default:
        org.hibernate.annotations.GenerationTime.ALWAYS