DATACMNS-800 - Polishing.

Update RxJava 2/3 repositories with deleteAllById(…). Reorder methods.

Original pull request: #476.
This commit is contained in:
Mark Paluch
2020-11-25 09:37:48 +01:00
parent bc76fcb7fc
commit ae4f0361af
4 changed files with 40 additions and 18 deletions

View File

@@ -110,14 +110,6 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
*/
void delete(T entity);
/**
* Deletes the given entities.
*
* @param entities must not be {@literal null}. Must not contain {@literal null} elements.
* @throws IllegalArgumentException in case the given {@literal entities} or one of its entities is {@literal null}.
*/
void deleteAll(Iterable<? extends T> entities);
/**
* Deletes all instances of the type {@code T} with the given IDs.
*
@@ -127,6 +119,14 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
*/
void deleteAllById(Iterable<? extends ID> ids);
/**
* Deletes the given entities.
*
* @param entities must not be {@literal null}. Must not contain {@literal null} elements.
* @throws IllegalArgumentException in case the given {@literal entities} or one of its entities is {@literal null}.
*/
void deleteAll(Iterable<? extends T> entities);
/**
* Deletes all entities managed by the repository.
*/

View File

@@ -170,16 +170,6 @@ public interface ReactiveCrudRepository<T, ID> extends Repository<T, ID> {
*/
Mono<Void> delete(T entity);
/**
* Deletes the given entities.
*
* @param entities must not be {@literal null}.
* @return {@link Mono} signaling when operation has completed.
* @throws IllegalArgumentException in case the given {@link Iterable entities} or one of its entities is
* {@literal null}.
*/
Mono<Void> deleteAll(Iterable<? extends T> entities);
/**
* Deletes all instances of the type {@code T} with the given IDs.
*
@@ -191,6 +181,16 @@ public interface ReactiveCrudRepository<T, ID> extends Repository<T, ID> {
*/
Mono<Void> deleteAllById(Iterable<? extends ID> ids);
/**
* Deletes the given entities.
*
* @param entities must not be {@literal null}.
* @return {@link Mono} signaling when operation has completed.
* @throws IllegalArgumentException in case the given {@link Iterable entities} or one of its entities is
* {@literal null}.
*/
Mono<Void> deleteAll(Iterable<? extends T> entities);
/**
* Deletes the given entities supplied by a {@link Publisher}.
*

View File

@@ -161,6 +161,17 @@ public interface RxJava2CrudRepository<T, ID> extends Repository<T, ID> {
*/
Completable delete(T entity);
/**
* Deletes all instances of the type {@code T} with the given IDs.
*
* @param ids must not be {@literal null}.
* @return {@link Completable} 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
*/
Completable deleteAllById(Iterable<? extends ID> ids);
/**
* Deletes the given entities.
*

View File

@@ -161,6 +161,17 @@ public interface RxJava3CrudRepository<T, ID> extends Repository<T, ID> {
*/
Completable delete(T entity);
/**
* Deletes all instances of the type {@code T} with the given IDs.
*
* @param ids must not be {@literal null}.
* @return {@link Completable} 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
*/
Completable deleteAllById(Iterable<? extends ID> ids);
/**
* Deletes the given entities.
*