diff --git a/pom.xml b/pom.xml
index fc4c44187e..29e2e2135b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
org.springframework.data
spring-data-neo4j
- 6.1.0-SNAPSHOT
+ 6.1.0-DATAGRAPH-1428-SNAPSHOT
Spring Data Neo4j
Next generation Object-Graph-Mapping for Spring Data.
@@ -116,7 +116,7 @@
${skipTests}
${skipTests}
- 2.5.0-SNAPSHOT
+ 2.4.0-DATACMNS-800-SNAPSHOT
../../../../spring-data-commons/src/main/asciidoc
diff --git a/src/main/java/org/springframework/data/neo4j/repository/support/SimpleNeo4jRepository.java b/src/main/java/org/springframework/data/neo4j/repository/support/SimpleNeo4jRepository.java
index da64763d21..6737661b2a 100644
--- a/src/main/java/org/springframework/data/neo4j/repository/support/SimpleNeo4jRepository.java
+++ b/src/main/java/org/springframework/data/neo4j/repository/support/SimpleNeo4jRepository.java
@@ -43,6 +43,7 @@
* @author Gerrit Meier
* @author Michael J. Simons
* @author Ján Šúr
+ * @author Jens Schauder
* @since 6.0
* @param the type of the domain class managed by this repository
* @param the type of the unique identifier of the domain class
@@ -168,4 +169,11 @@ public void deleteAll(Iterable extends T> entities) {
this.neo4jOperations.deleteAllById(ids, this.entityInformation.getJavaType());
}
+
+ @Override
+ @Transactional
+ public void deleteAllById(Iterable extends ID> ids) {
+
+ this.neo4jOperations.deleteAllById(ids, this.entityInformation.getJavaType());
+ }
}
diff --git a/src/main/java/org/springframework/data/neo4j/repository/support/SimpleReactiveNeo4jRepository.java b/src/main/java/org/springframework/data/neo4j/repository/support/SimpleReactiveNeo4jRepository.java
index e316f58407..d1cc68a844 100644
--- a/src/main/java/org/springframework/data/neo4j/repository/support/SimpleReactiveNeo4jRepository.java
+++ b/src/main/java/org/springframework/data/neo4j/repository/support/SimpleReactiveNeo4jRepository.java
@@ -40,6 +40,7 @@
*
* @author Gerrit Meier
* @author Michael J. Simons
+ * @author Jens Schauder
* @since 6.0
* @param the type of the domain class managed by this repository
* @param the type of the unique identifier of the domain class
@@ -195,11 +196,20 @@ public Mono deleteAll() {
public Mono deleteAll(Iterable extends T> entities) {
Assert.notNull(entities, "The given Iterable of entities must not be null!");
+
List ids = StreamSupport.stream(entities.spliterator(), false).map(this.entityInformation::getId)
.collect(Collectors.toList());
return this.neo4jOperations.deleteAllById(ids, this.entityInformation.getJavaType());
}
+ @Override
+ public Mono deleteAllById(Iterable extends ID> ids) {
+
+ Assert.notNull(ids, "The given Iterable of ids must not be null!");
+
+ return this.neo4jOperations.deleteAllById(ids, this.entityInformation.getJavaType());
+ }
+
/*
* (non-Javadoc)
* @see org.springframework.data.repository.reactive.ReactiveCrudRepository#deleteAll(org.reactivestreams.Publisher)
diff --git a/src/test/java/org/springframework/data/neo4j/integration/imperative/RepositoryIT.java b/src/test/java/org/springframework/data/neo4j/integration/imperative/RepositoryIT.java
index 6480c6a8ba..bd4dc4c8ae 100644
--- a/src/test/java/org/springframework/data/neo4j/integration/imperative/RepositoryIT.java
+++ b/src/test/java/org/springframework/data/neo4j/integration/imperative/RepositoryIT.java
@@ -20,6 +20,7 @@
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.tuple;
+import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
@@ -1892,6 +1893,20 @@ void deleteAllEntities(@Autowired PersonRepository repository) {
assertThat(repository.existsById(id2)).isFalse();
}
+ @Test // DATAGRAPH-1428
+ void deleteAllById(@Autowired PersonRepository repository) {
+
+ PersonWithAllConstructor person3 = new PersonWithAllConstructor(id1, TEST_PERSON1_NAME, TEST_PERSON1_FIRST_NAME,
+ TEST_PERSON_SAMEVALUE, true, 1L, TEST_PERSON1_BORN_ON, "something", Arrays.asList("a", "b"), NEO4J_HQ,
+ Instant.now());
+
+ repository.save(person3);
+
+ repository.deleteAllById(Arrays.asList(person1.getId(), person3.getId()));
+
+ assertThat(repository.findAll()).extracting(PersonWithAllConstructor::getId).containsExactly(id2);
+ }
+
@Test
void deleteAll(@Autowired PersonRepository repository) {
diff --git a/src/test/java/org/springframework/data/neo4j/integration/reactive/ReactiveRepositoryIT.java b/src/test/java/org/springframework/data/neo4j/integration/reactive/ReactiveRepositoryIT.java
index dbe21b6cd6..593bfb2992 100644
--- a/src/test/java/org/springframework/data/neo4j/integration/reactive/ReactiveRepositoryIT.java
+++ b/src/test/java/org/springframework/data/neo4j/integration/reactive/ReactiveRepositoryIT.java
@@ -104,6 +104,7 @@
* @author Gerrit Meier
* @author Michael J. Simons
* @author Philipp Tölle
+ * @author Jens Schauder
*/
@ExtendWith(Neo4jExtension.class)
@SpringJUnitConfig
@@ -1910,6 +1911,13 @@ void deleteAllEntitiesPublisher(@Autowired ReactivePersonRepository repository)
.concatWith(repository.existsById(id2)).as(StepVerifier::create).expectNext(false, false).verifyComplete();
}
+ @Test // DATAGRAPH-1428
+ void deleteAllById(@Autowired ReactivePersonRepository repository) {
+
+ repository.deleteAllById(Arrays.asList(person1.getId(), person2.getId())).then(repository.existsById(id1))
+ .concatWith(repository.existsById(id2)).as(StepVerifier::create).expectNext(false, false).verifyComplete();
+ }
+
@Test
void deleteSimpleRelationship(@Autowired ReactiveRelationshipRepository repository) {
try (Session session = createSession()) {
diff --git a/src/test/java/org/springframework/data/neo4j/repository/config/StartupLoggerTest.java b/src/test/java/org/springframework/data/neo4j/repository/config/StartupLoggerTest.java
index 00e5ccc6d1..273520c134 100644
--- a/src/test/java/org/springframework/data/neo4j/repository/config/StartupLoggerTest.java
+++ b/src/test/java/org/springframework/data/neo4j/repository/config/StartupLoggerTest.java
@@ -30,6 +30,6 @@ void startingMessageShouldFit() {
String message = new StartupLogger(StartupLogger.Mode.IMPERATIVE).getStartingMessage();
assertThat(message).matches(
- "Bootstrapping imperative Neo4j repositories based on an unknown version of SDN with Spring Data Commons v2\\.\\d+\\.\\d+.(RELEASE|SNAPSHOT) and Neo4j Driver v4\\.\\d+\\.\\d+(?:-.*)\\.");
+ "Bootstrapping imperative Neo4j repositories based on an unknown version of SDN with Spring Data Commons v2\\.\\d+\\.\\d+.(RELEASE|(?:DATACMNS-\\d+-)?SNAPSHOT) and Neo4j Driver v4\\.\\d+\\.\\d+(?:-.*)\\.");
}
}