问题
I am trying to write a simple Update query - Update table set col1 = val1, col2 = val2 where col3 = val3; Can you please provide an example of writing a simple UPDATE in Cassandra using the Query builder API?
回答1:
Try this out.
v1.x:
Query exampleQuery = update("table").with(set("col1", "val1")).and(set("col2","val2")).where(eq("col3","val3"));
v2.x:
Statement exampleQuery = update("table").with(set("col1", "val1")).and(set("col2","val2")).where(eq("col3","val3"));
Patrick
来源:https://stackoverflow.com/questions/19557110/cassandra-data-stax-query-builder-update