Annotation Type GeneratedValue


@Retention(CLASS) @Target(FIELD) public @interface GeneratedValue
Overrides the legacy Id.autoIncrement strategy for this identifier.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Names the counter used by SEQUENCE or TABLE generation.
    Chooses identifier generation, overriding Id.autoIncrement.
  • Element Details

    • strategy

      GenerationType strategy
      Chooses identifier generation, overriding Id.autoIncrement. Generated composite identifiers are not supported.
      Returns:
      generation strategy; IDENTITY by default
      Default:
      IDENTITY
    • generator

      String generator
      Names the counter used by SEQUENCE or TABLE generation.
      Returns:
      counter name; empty derives a name from the table and key column
      Default:
      ""