diff --git a/pom.xml b/pom.xml index 9f675e8b85..48650ca622 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-commons - 2.4.0-SNAPSHOT + 2.4.0-DATACMNS-800-SNAPSHOT Spring Data Core diff --git a/src/main/java/org/springframework/data/repository/CrudRepository.java b/src/main/java/org/springframework/data/repository/CrudRepository.java index feeb07f7bc..28a30a2d47 100644 --- a/src/main/java/org/springframework/data/repository/CrudRepository.java +++ b/src/main/java/org/springframework/data/repository/CrudRepository.java @@ -22,6 +22,7 @@ * * @author Oliver Gierke * @author Eberhard Wolff + * @author Jens Schauder */ @NoRepositoryBean public interface CrudRepository extends Repository { @@ -117,6 +118,15 @@ public interface CrudRepository extends Repository { */ void deleteAll(Iterable entities); + /** + * Deletes all instances of the type {@code T} with the given IDs. + * + * @param ids must not be {@literal null}. Must not contain {@literal null} elements. + * @throws IllegalArgumentException in case the given {@literal ids} or one of its elements is {@literal null}. + * @since 2.5 + */ + void deleteAllById(Iterable ids); + /** * Deletes all entities managed by the repository. */ diff --git a/src/main/java/org/springframework/data/repository/reactive/ReactiveCrudRepository.java b/src/main/java/org/springframework/data/repository/reactive/ReactiveCrudRepository.java index 022084b999..77d9294187 100644 --- a/src/main/java/org/springframework/data/repository/reactive/ReactiveCrudRepository.java +++ b/src/main/java/org/springframework/data/repository/reactive/ReactiveCrudRepository.java @@ -28,6 +28,7 @@ * * @author Mark Paluch * @author Christph Strobl + * @author Jens Schauder * @since 2.0 * @see Mono * @see Flux @@ -179,6 +180,17 @@ public interface ReactiveCrudRepository extends Repository { */ Mono deleteAll(Iterable entities); + /** + * Deletes all instances of the type {@code T} with the given IDs. + * + * @param ids must not be {@literal null}. + * @return {@link Mono} signaling when operation has completed. + * @throws IllegalArgumentException in case the given {@literal ids} or one of its elements is {@literal null}. + * {@literal null}. + * @since 2.5 + */ + Mono deleteAllById(Iterable ids); + /** * Deletes the given entities supplied by a {@link Publisher}. *