Annotation Type Identity


@Retention(RUNTIME) @Target({FIELD,TYPE}) public @interface Identity
Defines identity generation for an associated entity bean.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    Optional CACHE option for database IDENTITY or SEQUENCE.
    For IDENTITY type specify the generated mode of ALWAYS or BY DEFAULT.
    int
    Optional INCREMENT BY value of an IDENTITY or SEQUENCE.
    Sequence name when using type SEQUENCE.
    int
    Optional START WITH value of an IDENTITY or SEQUENCE.
    The type of identity for the associated entity bean.
  • Element Details

    • type

      The type of identity for the associated entity bean.
      Default:
      AUTO
    • generated

      For IDENTITY type specify the generated mode of ALWAYS or BY DEFAULT.
      Default:
      AUTO
    • sequenceName

      String sequenceName
      Sequence name when using type SEQUENCE. When not specified the naming convention will define the sequence name.
      Default:
      ""
    • start

      int start
      Optional START WITH value of an IDENTITY or SEQUENCE.
      Default:
      0
    • increment

      int increment
      Optional INCREMENT BY value of an IDENTITY or SEQUENCE.
      Default:
      0
    • cache

      int cache
      Optional CACHE option for database IDENTITY or SEQUENCE.

      Used by some databases for a performance improvement providing identity and sequence values with the potential for gaps and non strict ordering of values being used.

      Default:
      0