Skip to content

Commit 1ac3660

Browse files
committed
GH-2655 - Find child relationships reliable.
Don't exclude relationships only by their field name but also by their target entity.
1 parent 3cf0aa5 commit 1ac3660

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,9 @@ public Collection<RelationshipDescription> getRelationshipsInHierarchy(Predicate
482482
childDescription.getRelationships().forEach(concreteRelationship -> {
483483

484484
String fieldName = concreteRelationship.getFieldName();
485+
NodeDescription<?> target = concreteRelationship.getTarget();
485486

486-
if (relationships.stream().noneMatch(relationship -> relationship.getFieldName().equals(fieldName))) {
487+
if (relationships.stream().noneMatch(relationship -> relationship.getFieldName().equals(fieldName) && relationship.getTarget().equals(target))) {
487488
relationships.add(concreteRelationship);
488489
}
489490
});

0 commit comments

Comments
 (0)