2016-06-14 50 views
0

是否有可能獲取Update Statement中受影響的行?Spring Data Cassandra - 檢索受影響的行

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操作那樣做。

回答