From 06b1f1a538800e03e8a76b0e48b68de5d4ef57da 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 068e360cd..b2b6fd0e8 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 @@ -116,7 +116,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 c0d5abf9b..45a6c0bdb 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 @@ -139,7 +139,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); } /**