Skip to content

Commit 4d96513

Browse files
committed
GH-2550 - Accept list and plain values in result.
Closes #2550
1 parent 3d451e3 commit 4d96513

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/main/java/org/springframework/data/neo4j/core/mapping/DefaultNeo4jEntityConverter.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,10 @@ private Collection<Node> extractNodes(MapAccessor allValues) {
690690
.flatMap(entry -> MappingSupport.extractNodesFromCollection(listType, entry).stream())
691691
.forEach(allNodesInResult::add);
692692

693-
if (allNodesInResult.isEmpty()) {
694-
StreamSupport.stream(allValues.values().spliterator(), false)
695-
.filter(this.nodeType::isTypeOf)
696-
.map(Value::asNode)
697-
.forEach(allNodesInResult::add);
698-
}
693+
StreamSupport.stream(allValues.values().spliterator(), false)
694+
.filter(this.nodeType::isTypeOf)
695+
.map(Value::asNode)
696+
.forEach(allNodesInResult::add);
699697

700698
return allNodesInResult;
701699
}
@@ -717,12 +715,10 @@ private Collection<Relationship> extractRelationships(MapAccessor allValues) {
717715
.flatMap(entry -> MappingSupport.extractRelationshipsFromCollection(listType, entry).stream())
718716
.forEach(allRelationshipsInResult::add);
719717

720-
if (allRelationshipsInResult.isEmpty()) {
721-
StreamSupport.stream(allValues.values().spliterator(), false)
722-
.filter(this.relationshipType::isTypeOf)
723-
.map(Value::asRelationship)
724-
.forEach(allRelationshipsInResult::add);
725-
}
718+
StreamSupport.stream(allValues.values().spliterator(), false)
719+
.filter(this.relationshipType::isTypeOf)
720+
.map(Value::asRelationship)
721+
.forEach(allRelationshipsInResult::add);
726722

727723
return allRelationshipsInResult;
728724
}

0 commit comments

Comments
 (0)