Spring Cassandra Operation with If Clause

416 views Asked by At

I am trying Cassandra with Spring

I have the Table and Persistence Object, Works Well.

With Cassandra (CQL script) I can make a sentence with: update ...,set ..., where, .. if ..,

My question is If I can use Spring Cassandra Operation (org.springframework.data.cassandra.core.CassandraOperation) with an Additional "If Sentence".

I want to have a version column and Work with Optimistic Locking (I dont Know yet if this is the best way)

1

There are 1 answers

0
OrangeDog On BEST ANSWER

Spring Data does not support lightweight transactions (IF clauses). You'll have to build com.datastax.driver.core.Statements and execute them with CqlOperations.