The best way to store my value
Hi all,
I am a beginner with Oracle NoSQL so I explain my use case :
I have an object called Position coming from Coherence.
Position {
int id
string symbol
int amount
double price
}
I wonder what is the best way to store this object knowing that I want to do some queries like "select position from xxx where symbol = "ORCL", "select symbol, count(symbol) from xxx group by symbol" (I know we cannot use SQL it is just to give you easily an idea of my need)
1) Like that
majorComponents = new ArrayList<String>();
majorComponents.add("position");
majorComponents.add(String.valueOf(position.getId()));
myKey = Key.createKey(majorComponents);
myValue = Value.createValue(SerializationUtils.serialize(position));
store.put(myKey, myValue);
2) Or like that
majorComponents = new ArrayList<String>();
majorComponents.add("position");
majorComponents.add(String.valueOf(position.getId()));
minorComponents.add("symbol");
myKey = createKey(majorComponents, minorComponents);
myValue = Value.createValue(SerializationUtils.serialize(position.getSymbol));
store.put(myKey, myValue);
etc...with amount and price
Thank you for all...