From 1ec62306911ed275708d86bdf9a1b9b688793f8e Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Thu, 14 Nov 2024 10:20:53 +0100 Subject: [PATCH] Correctly invoke `update` from `CassandraBatchOperations.update`. Previously, we've called `insert` instead of `update`. Closes #1534 --- .../data/cassandra/core/CassandraBatchOperations.java | 2 +- .../data/cassandra/core/ReactiveCassandraBatchOperations.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/CassandraBatchOperations.java b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/CassandraBatchOperations.java index c17799a5a..02bd3aec7 100644 --- a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/CassandraBatchOperations.java +++ b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/CassandraBatchOperations.java @@ -159,7 +159,7 @@ default CassandraBatchOperations update(Object entity, WriteOptions options) { Assert.notNull(entity, "Entity must not be null"); - return insert(Collections.singleton(entity), options); + return update(Collections.singleton(entity), options); } /** diff --git a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/ReactiveCassandraBatchOperations.java b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/ReactiveCassandraBatchOperations.java index fcf4cf8fd..6d4046c9a 100644 --- a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/ReactiveCassandraBatchOperations.java +++ b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/ReactiveCassandraBatchOperations.java @@ -210,7 +210,7 @@ default ReactiveCassandraBatchOperations update(Object entity, WriteOptions opti Assert.notNull(entity, "Entity must not be null"); - return insert(Collections.singleton(entity), options); + return update(Collections.singleton(entity), options); } /**