Anju
Anju

Reputation: 641

GridGain: How to add composite primary keys

In GridGain, I have to load data such that the primary key is a composite key.

Say I have

class Person{
    int id;
    int officeId;
    ...
}

Here I want to add as primary key both id and officeId. Is it possible to add a composite key in GridGain?

Upvotes: 1

Views: 115

Answers (1)

Dmitriy
Dmitriy

Reputation: 2292

in GridGain any Object can be used as a key, just like with HashMaps. You need to make sure that you override equals(...) and hashCode() methods for the composite keys.

Upvotes: 2

Related Questions