Search code examples
cassandraspring-data-cassandradata-persistence

Spring Cassandra Operation with If Clause


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)


Solution

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