Skip to content

Commit 8777354

Browse files
committed
DATAGRAPH-1428 - Implement deleteAllById(Iterable<ID> ids).
1 parent 9ca86ee commit 8777354

File tree

4 files changed

+119
-88
lines changed

4 files changed

+119
-88
lines changed

src/main/java/org/springframework/data/neo4j/repository/support/SimpleNeo4jRepository.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* @author Gerrit Meier
4444
* @author Michael J. Simons
4545
* @author Ján Šúr
46+
* @author Jens Schauder
4647
* @since 6.0
4748
* @param <T> the type of the domain class managed by this repository
4849
* @param <ID> the type of the unique identifier of the domain class
@@ -168,4 +169,11 @@ public void deleteAll(Iterable<? extends T> entities) {
168169

169170
this.neo4jOperations.deleteAllById(ids, this.entityInformation.getJavaType());
170171
}
172+
173+
@Override
174+
@Transactional
175+
public void deleteAllById(Iterable<? extends ID> ids) {
176+
177+
this.neo4jOperations.deleteAllById(ids, this.entityInformation.getJavaType());
178+
}
171179
}

src/main/java/org/springframework/data/neo4j/repository/support/SimpleReactiveNeo4jRepository.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
*
4141
* @author Gerrit Meier
4242
* @author Michael J. Simons
43+
* @author Jens Schauder
4344
* @since 6.0
4445
* @param <T> the type of the domain class managed by this repository
4546
* @param <ID> the type of the unique identifier of the domain class
@@ -195,11 +196,20 @@ public Mono<Void> deleteAll() {
195196
public Mono<Void> deleteAll(Iterable<? extends T> entities) {
196197

197198
Assert.notNull(entities, "The given Iterable of entities must not be null!");
199+
198200
List<ID> ids = StreamSupport.stream(entities.spliterator(), false).map(this.entityInformation::getId)
199201
.collect(Collectors.toList());
200202
return this.neo4jOperations.deleteAllById(ids, this.entityInformation.getJavaType());
201203
}
202204

205+
@Override
206+
public Mono<Void> deleteAllById(Iterable<? extends ID> ids) {
207+
208+
Assert.notNull(ids, "The given Iterable of ids must not be null!");
209+
210+
return this.neo4jOperations.deleteAllById(ids, this.entityInformation.getJavaType());
211+
}
212+
203213
/*
204214
* (non-Javadoc)
205215
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#deleteAll(org.reactivestreams.Publisher)

0 commit comments

Comments
 (0)