DATACMNS-800 - Adds deleteAllById to ReactiveCrudRepository and CrudRepository.
CrudRepository and ReactiveCrudRepository now expose a deleteAllById(Iterable<ID>) method to delete multiple entities by their Id. Original pull request: #476.
This commit is contained in:
committed by
Mark Paluch
parent
1512e878c4
commit
bc76fcb7fc
@@ -22,6 +22,7 @@ import java.util.Optional;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Eberhard Wolff
|
||||
* @author Jens Schauder
|
||||
*/
|
||||
@NoRepositoryBean
|
||||
public interface CrudRepository<T, ID> extends Repository<T, ID> {
|
||||
@@ -117,6 +118,15 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
|
||||
*/
|
||||
void deleteAll(Iterable<? extends T> 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<? extends ID> ids);
|
||||
|
||||
/**
|
||||
* Deletes all entities managed by the repository.
|
||||
*/
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.springframework.data.repository.Repository;
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christph Strobl
|
||||
* @author Jens Schauder
|
||||
* @since 2.0
|
||||
* @see Mono
|
||||
* @see Flux
|
||||
@@ -179,6 +180,17 @@ public interface ReactiveCrudRepository<T, ID> extends Repository<T, ID> {
|
||||
*/
|
||||
Mono<Void> deleteAll(Iterable<? extends T> 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<Void> deleteAllById(Iterable<? extends ID> ids);
|
||||
|
||||
/**
|
||||
* Deletes the given entities supplied by a {@link Publisher}.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user