Thursday, June 23, 2011

Cassandra Hector api 0.7 - retreiving multiple columns

RETRIEVING MULTIPLE COLUMNS WITH SLICERANGE
To retrieve the three columns inserted in the previous example in a single query, use HFactory to construct a SliceQuery for those columns:
// given Keyspace ko and StringSerializer se
SliceQuery q = HFactory.createSliceQuery(ko, se, se, se);
q.setColumnFamily(cf)
.setKey("jsmith")
.setColumnNames("first", "last", "middle");
Result<columnslice<string, string="">> r = q.execute();

No comments:

Post a Comment