Annotation Type PartitionKey
-
@Target({FIELD,METHOD}) @Retention(RUNTIME) public @interface PartitionKey
Annotates the field or getter of anEntityproperty, to indicate that it's part of the partition key.Example:
@PartitionKey private UUID id;
This information is used by the mapper processor to generate default queries (for example a basicSelect). Note that an entity is not required to have a partition key, for example if it only gets mapped as a UDT.If the partition key is composite, you must specify
value()to indicate the position of each property:@PartitionKey(1) private int pk1; @PartitionKey(2) private int pk2;
If you don't specify positions, or if there are duplicates, the mapper processor will issue a compile-time error.This annotation is mutually exclusive with
ClusteringColumn.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description intvalueThe position of the property in the partition key.
-