是否有可能在更新语句中获得受影响的行?
public void removeCountry(String id,int version) throws VersionException {
log.debug("Update row"+id);
try {
Update update = QueryBuilder.update("country");
update.setConsistencyLevel(ConsistencyLevel.ONE);
update.with(QueryBuilder.set("destroyed", true));
update.where(QueryBuilder.eq("id",id));
update.where(QueryBuilder.eq("version",version));
cassandraOperations.execute(update);
//How to I know if the row was updated
int rows = 0;//complete
if (rows==0) throw new VersionException("Row does not been updated yet);
} catch (Exception e) {
log.error(e.getMessage(),e);
}
}
我是 Cassandra 的新手,所以我不知道我是否可以像 JDBC 操作那样做到这一点。