From 125cdb88119923110aee808202f3d23087d9d837 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 14 Mar 2017 16:47:44 +0100 Subject: [PATCH] DATACASS-396 - Use single statements for to save/delete each item of a collection via CassandraRepository. We now issue individual statements to save and delete each element of a collection of objects when used with CassandraRepository.save(Iterable) and CassandraRepository.delete(Iterable). Previously, the collection argument was considered an entity. Save/delete do not use batch operations to prevent accidental wrong use of Cassandra batches. --- .../repository/support/SimpleCassandraRepository.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/support/SimpleCassandraRepository.java b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/support/SimpleCassandraRepository.java index 32cbb3d49..db14f46a3 100644 --- a/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/support/SimpleCassandraRepository.java +++ b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/support/SimpleCassandraRepository.java @@ -71,7 +71,7 @@ public class SimpleCassandraRepository implements Ty @Override public List save(Iterable entities) { - Assert.notNull(entities, "The given Iterable of entities not be null!"); + Assert.notNull(entities, "The given Iterable of entities must not be null"); List result = new ArrayList<>(); @@ -138,7 +138,7 @@ public class SimpleCassandraRepository implements Ty @Override public void delete(Iterable entities) { - Assert.notNull(entities, "The given Iterable of entities not be null!"); + Assert.notNull(entities, "The given Iterable of entities must not be null"); for (T entity : entities) { operations.delete(entity);