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.
This commit is contained in:
@@ -71,7 +71,7 @@ public class SimpleCassandraRepository<T, ID extends Serializable> implements Ty
|
||||
@Override
|
||||
public <S extends T> List<S> save(Iterable<S> 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<S> result = new ArrayList<>();
|
||||
|
||||
@@ -138,7 +138,7 @@ public class SimpleCassandraRepository<T, ID extends Serializable> implements Ty
|
||||
@Override
|
||||
public void delete(Iterable<? extends T> 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);
|
||||
|
||||
Reference in New Issue
Block a user