I have two classes that have M-N Relationship and one of that class have Parent Class. The problem is, I want to return list of object when I call leftRightRepository.findByLeftParentId(id) but it always return an empty List.
@NodeEntity
public class Right{
@GraphId
Long graphId;
String id; //random generated UUID
String name;
//Properties & Constructor
}
@NodeEntity
public class Left{
@GraphId
Long graphId;
String id; //random generated UUID
String name;
ParentClass parent;
//Properties & Constructor
}
@NodeEntity
public class ParentClass{
@GraphId
Long graphId;
String id; //random generated UUID
String name;
//Properties & Constructor
}
@NodeEntity
public class LeftRight {
@GraphId
Long graphId;
String id;
@Relationship(type = "LEFTRIGHT_LEFT", direction = "OUTGOING")
private Left left;
@Relationship(type = "LEFTRIGHT_RIGHT", direction = "OUTGOING")
private Right right;
//Properties & Constructor
}
To make it easier, I attach the picture of my Nodes
When I check with findAll(), and then look at the property, it have correct parent Id. Is it Bug? In SDN3, Its work, but in SDN4, I cannot use it again.
And I try a little workaround code, with findByLeftId(List ID). In SDN3 it work too, but in SDN4 it not work again.
SDN 4 / Neo4j OGM only supports one level of nesting at this point in time. The finder you are trying to execute is two levels of nesting: LeftRight
->left
->parent
The only alternative now is a custom @Query.
Perhaps you can also log a feature request here