Skip to content

Commit fa9d64c

Browse files
GH-2356 - Use specified target database name.
Fixes #2356.
1 parent 0461235 commit fa9d64c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/main/java/org/springframework/data/neo4j/core/Neo4jTemplate.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ class Tuple3<T> {
351351
.collect(Collectors.toList());
352352
Map<Value, Long> idToInternalIdMapping = neo4jClient
353353
.query(() -> renderer.render(cypherGenerator.prepareSaveOfMultipleInstancesOf(entityMetaData)))
354+
.in(databaseName)
354355
.bind(entityList).to(Constants.NAME_OF_ENTITY_LIST_PARAM)
355356
.fetchAs(Map.Entry.class)
356357
.mappedBy((t, r) -> new AbstractMap.SimpleEntry<>(r.get(Constants.NAME_OF_ID), r.get(Constants.NAME_OF_INTERNAL_ID).asLong()))

src/main/java/org/springframework/data/neo4j/core/ReactiveNeo4jTemplate.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ public <T> Flux<T> saveAll(Iterable<T> instances) {
346346
.map(binderFunction).collect(Collectors.toList());
347347
return neo4jClient
348348
.query(() -> renderer.render(cypherGenerator.prepareSaveOfMultipleInstancesOf(entityMetaData)))
349+
.in(databaseName.getValue())
349350
.bind(boundedEntityList).to(Constants.NAME_OF_ENTITY_LIST_PARAM)
350351
.fetchAs(Tuple2.class)
351352
.mappedBy((t, r) -> Tuples.of(r.get(Constants.NAME_OF_ID), r.get(Constants.NAME_OF_INTERNAL_ID).asLong()))

0 commit comments

Comments
 (0)