Annotation Interface Id


@Retention(CLASS) @Target(FIELD) public @interface Id
Marks the ID property of an @Entity. The property must be of type long (or Long in Kotlin) and have not-private visibility (or a not-private getter and setter method).

ID properties are unique and indexed by default.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Allows IDs of new entities to be assigned manually.
  • Element Details

    • assignable

      boolean assignable
      Allows IDs of new entities to be assigned manually. Warning: This has side effects, check the online documentation on self-assigned object IDs for details.

      This may allow re-use of IDs assigned elsewhere, e.g. by a server.

      Default:
      false