I agree with Zanson/Valchkou. DataStax Java Driver is the future. It's very convenient to operate Cassandra with SQL. Meanwhile, I also recommend CassandraExecutor, a simple wrapper of DataStax Java Driver. Comparing to the Java Driver, CassandraExecutor has below features:
- Consistent/Integrated/Concise APIs for (sync/Async) operations(CRUD) with SQL/entity.
- DataSet, which supports distinct/merge/sort/groupBy/join/union/unionAll/except/intersect/paginate/filter/count/toJOSN/toXML/toCVS...
Here is a simple CRUD(create/read/update/delete) sample:
Account account = createAccount();
// create
String sql_insert = NE.insert(ID, GUI, FIRST_NAME, LAST_NAME, LAST_UPDATE_TIME, CREATE_TIME).into(Account.class).sql();
cassandraExecutor.execute(sql_insert, account);
// read
String sql_selectByGUI = NE.select(ID, GUI, FIRST_NAME, LAST_NAME).from(Account._).where(L.eq(ID, L.QME)).sql();
Account dbAccount = cassandraExecutor.queryForEntity(Account.class, sql_selectByGUI, account);
// update
String sql_updateByLastName = NE.update(Account.class).set(FIRST_NAME).where(L.eq(ID, L.QME)).sql();
dbAccount.setFirstName("newFirstName");
cassandraExecutor.execute(sql_updateByLastName, dbAccount);
// delete
String sql_deleteByFirstName = NE.deleteFrom(Account.class).where(L.eq(ID, L.QME)).sql();
cassandraExecutor.execute(sql_deleteByFirstName, dbAccount);
(Declaration:I'm the developer of CassandraExecutor)