How to comment out / use a composite section key in Cassandra in java?
I know I can use the partition key by annotating @PartitionKey when the partition key is simple (single column). How can I do the same if the partition key is composite.
I couldn't find anything for this in the datastax documentation and google didn't help either.
+3
Amit
source
to share
1 answer
Here's an example with one column:
@PartitionKey
private UUID userId;
And with a composite key:
@PartitionKey(0)
private int pk1;
@PartitionKey(1)
private int pk2;
+5
Olivier michallat
source
to share