Skip to content

Commit ae4f036

Browse files
committed
DATACMNS-800 - Polishing.
Update RxJava 2/3 repositories with deleteAllById(…). Reorder methods. Original pull request: #476.
1 parent bc76fcb commit ae4f036

File tree

4 files changed

+39
-17
lines changed

4 files changed

+39
-17
lines changed

src/main/java/org/springframework/data/repository/CrudRepository.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,6 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
110110
*/
111111
void delete(T entity);
112112

113-
/**
114-
* Deletes the given entities.
115-
*
116-
* @param entities must not be {@literal null}. Must not contain {@literal null} elements.
117-
* @throws IllegalArgumentException in case the given {@literal entities} or one of its entities is {@literal null}.
118-
*/
119-
void deleteAll(Iterable<? extends T> entities);
120-
121113
/**
122114
* Deletes all instances of the type {@code T} with the given IDs.
123115
*
@@ -127,6 +119,14 @@ public interface CrudRepository<T, ID> extends Repository<T, ID> {
127119
*/
128120
void deleteAllById(Iterable<? extends ID> ids);
129121

122+
/**
123+
* Deletes the given entities.
124+
*
125+
* @param entities must not be {@literal null}. Must not contain {@literal null} elements.
126+
* @throws IllegalArgumentException in case the given {@literal entities} or one of its entities is {@literal null}.
127+
*/
128+
void deleteAll(Iterable<? extends T> entities);
129+
130130
/**
131131
* Deletes all entities managed by the repository.
132132
*/

src/main/java/org/springframework/data/repository/reactive/ReactiveCrudRepository.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,25 +171,25 @@ public interface ReactiveCrudRepository<T, ID> extends Repository<T, ID> {
171171
Mono<Void> delete(T entity);
172172

173173
/**
174-
* Deletes the given entities.
174+
* Deletes all instances of the type {@code T} with the given IDs.
175175
*
176-
* @param entities must not be {@literal null}.
176+
* @param ids must not be {@literal null}.
177177
* @return {@link Mono} signaling when operation has completed.
178-
* @throws IllegalArgumentException in case the given {@link Iterable entities} or one of its entities is
178+
* @throws IllegalArgumentException in case the given {@literal ids} or one of its elements is {@literal null}.
179179
* {@literal null}.
180+
* @since 2.5
180181
*/
181-
Mono<Void> deleteAll(Iterable<? extends T> entities);
182+
Mono<Void> deleteAllById(Iterable<? extends ID> ids);
182183

183184
/**
184-
* Deletes all instances of the type {@code T} with the given IDs.
185+
* Deletes the given entities.
185186
*
186-
* @param ids must not be {@literal null}.
187+
* @param entities must not be {@literal null}.
187188
* @return {@link Mono} signaling when operation has completed.
188-
* @throws IllegalArgumentException in case the given {@literal ids} or one of its elements is {@literal null}.
189+
* @throws IllegalArgumentException in case the given {@link Iterable entities} or one of its entities is
189190
* {@literal null}.
190-
* @since 2.5
191191
*/
192-
Mono<Void> deleteAllById(Iterable<? extends ID> ids);
192+
Mono<Void> deleteAll(Iterable<? extends T> entities);
193193

194194
/**
195195
* Deletes the given entities supplied by a {@link Publisher}.

src/main/java/org/springframework/data/repository/reactive/RxJava2CrudRepository.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@ public interface RxJava2CrudRepository<T, ID> extends Repository<T, ID> {
161161
*/
162162
Completable delete(T entity);
163163

164+
/**
165+
* Deletes all instances of the type {@code T} with the given IDs.
166+
*
167+
* @param ids must not be {@literal null}.
168+
* @return {@link Completable} signaling when operation has completed.
169+
* @throws IllegalArgumentException in case the given {@literal ids} or one of its elements is {@literal null}.
170+
* {@literal null}.
171+
* @since 2.5
172+
*/
173+
Completable deleteAllById(Iterable<? extends ID> ids);
174+
164175
/**
165176
* Deletes the given entities.
166177
*

src/main/java/org/springframework/data/repository/reactive/RxJava3CrudRepository.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,17 @@ public interface RxJava3CrudRepository<T, ID> extends Repository<T, ID> {
161161
*/
162162
Completable delete(T entity);
163163

164+
/**
165+
* Deletes all instances of the type {@code T} with the given IDs.
166+
*
167+
* @param ids must not be {@literal null}.
168+
* @return {@link Completable} signaling when operation has completed.
169+
* @throws IllegalArgumentException in case the given {@literal ids} or one of its elements is {@literal null}.
170+
* {@literal null}.
171+
* @since 2.5
172+
*/
173+
Completable deleteAllById(Iterable<? extends ID> ids);
174+
164175
/**
165176
* Deletes the given entities.
166177
*

0 commit comments

Comments
 (0)