-
Notifications
You must be signed in to change notification settings - Fork 617
Closed
Description
SDN is unable to save nodes using a projection that recursively references itself.
For example, say you have a node entity that recursively references itself
@Getter
@Node
public class Person {
private String name;
private List<Person> children = new LinkedList<>();
}
And a corresponding projection that references itself as well
public interface PersonWithChildrenRecursive {
String getName();
List<PersonWithChildrenRecursive> getChildren();
}
You cannot save a node using this projection
Person alice = new Person();
alice.setName("Alice");
neo4jTemplate.saveAs(alice, PersonWithChildrenRecursive.class); // throws StackOverflowError
Note that other ways to save will succeed, such as CrudRepository.save
or Neo4jTemplate.saveAs
with a projection that is not recursive.
I have an example app that reproduces the bug.
I don't know if this a new bug or a regression. I noticed it first while using 6.3.3-SNAPSHOT but the bug is present in 6.3.2 as well.
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug