GH-2655 - Find child relationships reliable.
Don't exclude relationships only by their field name but also by their target entity.
This commit is contained in:
@@ -482,8 +482,9 @@ final class DefaultNeo4jPersistentEntity<T> extends BasicPersistentEntity<T, Neo
|
||||
childDescription.getRelationships().forEach(concreteRelationship -> {
|
||||
|
||||
String fieldName = concreteRelationship.getFieldName();
|
||||
NodeDescription<?> target = concreteRelationship.getTarget();
|
||||
|
||||
if (relationships.stream().noneMatch(relationship -> relationship.getFieldName().equals(fieldName))) {
|
||||
if (relationships.stream().noneMatch(relationship -> relationship.getFieldName().equals(fieldName) && relationship.getTarget().equals(target))) {
|
||||
relationships.add(concreteRelationship);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user