GH-2488 - Use default database selection.

Fixes #2488.
This commit is contained in:
Michael Simons
2022-04-04 18:31:17 +02:00
parent 2bd53c6296
commit f4b57805c5
2 changed files with 4 additions and 3 deletions

View File

@@ -129,7 +129,7 @@ public final class Neo4jTemplate implements
this(neo4jClient, neo4jMappingContext, EntityCallbacks.create());
if (databaseSelectionProvider != neo4jClient.getDatabaseSelectionProvider()) {
if (!Objects.equals(databaseSelectionProvider, neo4jClient.getDatabaseSelectionProvider())) {
throw new IllegalStateException(
"The provided database selection provider differs from the Neo4jClient's one.");
}
@@ -141,7 +141,7 @@ public final class Neo4jTemplate implements
this(neo4jClient, neo4jMappingContext, entityCallbacks);
if (databaseSelectionProvider != neo4jClient.getDatabaseSelectionProvider()) {
if (!Objects.equals(databaseSelectionProvider, neo4jClient.getDatabaseSelectionProvider())) {
throw new IllegalStateException(
"The provided database selection provider differs from the Neo4jClient's one.");
}

View File

@@ -36,6 +36,7 @@ import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference;
@@ -131,7 +132,7 @@ public final class ReactiveNeo4jTemplate implements
ReactiveDatabaseSelectionProvider databaseSelectionProvider) {
this(neo4jClient, neo4jMappingContext);
if (databaseSelectionProvider != neo4jClient.getDatabaseSelectionProvider()) {
if (!Objects.equals(databaseSelectionProvider, neo4jClient.getDatabaseSelectionProvider())) {
throw new IllegalStateException("The provided database selection provider differs from the ReactiveNeo4jClient's one.");
}
}