Annotation Interface PrimaryKey


Identifies the primary key field of the entity, which may be of a basic type or of a type that represents a composite primary key class. This field corresponds to the PRIMARY KEY of the corresponding Cassandra table. Only one field in a given type hierarchy may be annotated with this annotation.

Remember, if the Cassandra table has multiple primary key columns, then you must define a class annotated with PrimaryKeyClass to represent the primary key!

Use PrimaryKeyColumn in conjunction with Id to specify extended primary key column properties.

Author:
Alex Shvid, Matthew T. Adams, Mark Paluch
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Deprecated.
    since 3.0.
    The column name for the primary key if it is of a simple type, else ignored.
  • Element Details

    • value

      The column name for the primary key if it is of a simple type, else ignored.
      Default:
      ""
    • forceQuote

      @Deprecated @AliasFor(annotation=Column.class, attribute="forceQuote") boolean forceQuote
      Deprecated.
      since 3.0. The column name gets converted into CqlIdentifier hence it no longer requires an indication whether the name should be quoted.
      Whether to cause the column name to be force-quoted if the primary key is of a simple type, else ignored.
      See Also:
      • CqlIdentifier.fromInternal(String)
      Default:
      false