Having trouble with getting related nodes of a certain node entity. For example this class
@NodeEntity
public class A extends Entity {
@Relationship(type = ARRelation.TYPE, direction = Relationship.OUTGOING)
private R r;
}
Suppose I have the above node (A)-[]-(R) in the database. When I make the query in a spring data repository
MATCH (a:A)
WITH A MATCH p=(a)-[]-()
RETURN a, relationships(p), nodes(p)
I expected to get back my A objects with my R objects such that when I do A.getR(), I would get R. However my R object is always returned as null. On creation, this works and if I do A.setR(rInstance) and then save to the database, then they are both saved. But on the getting from the database I always get null. The query does in fact work in the neo4j console.
Interestingly if I change the node entity to
@NodeEntity
public class A extends Entity {
@Relationship(type = ARRelation.TYPE, direction = Relationship.OUTGOING)
private ARRelation r;
}
Then the relationship is returned but now when I do A.getR(), I get back the actual relation with both the A and R object in it. However, then creation does not work properly.
Any help is appreciated.