DATACASS-575 - Support IF conditions in lightweight transactions with UPDATE and DELETE.

We now support conditions in lightweight transactions for UPDATE and DELETE statements. Conditions are Filter objects similar to the WHERE clause. Conditions are supported for entity and query-based update/delete methods.

UpdateOptions options = UpdateOptions.builder().ifCondition(where("firstname").is("Walter")).build();
User user = new User("heisenberg", "Walter", "White");
template.update(user, options);

DeleteOptions options = DeleteOptions.builder().ifCondition(where("counter").is(42)).build();
Query query = Query.query(where("id").is("heisenberg")).queryOptions(options);
template.delete(query, User.class);
This commit is contained in:
Mark Paluch
2019-01-29 13:57:48 +01:00
committed by John Blum
parent 314bbb1261
commit 0e624c9cc4
14 changed files with 728 additions and 150 deletions

View File

@@ -8,6 +8,8 @@ This chapter summarizes changes and new features for each release.
* Read-only properties annotated with `@ReadOnlyProperty` to exclude non-writable properties from entity-bound `INSERT` and `UPDATE` operations.
* Support for derived `Between` queries.
* Kotlin Coroutine extensions for `ReactiveFluentCassandraOperations`.
* Lightweight transaction support via `DeleteOptions` using the Template API.
* Filter conditions for lightweight transaction update and delete (`UPDATE … IF <condition>`, `DELETE … IF <condition>`).
[[new-features.2-1-0]]
== What's new in Spring Data for Apache Cassandra 2.1