class Node {
Long id;
String name;
@Relationship(type="NodeToCategory")
Address address;
List<NodeB> nodeBList;
}
//node B CLass
class NodeB {
Long id;
String someOther;
@Relationship(type="NodeToCategory")
Address address;
List<NodeC> nodeCList;
}
class Address {
Long id;
String name;
}
When I run a query with depth 2 on the Node it returns nodeBList but it does not return addresses of NodeB. I want to make sure whenever there is an address object it will always return address no matter the depth . It should not return Addresses of NodeB as Null .
One way of doing is to load all the address before and then trying to load
Node . I am trying to avoid that. Is there any way of doing it via any annotations or other features that I do not know of in neo4jOGM ?
You can achieved it by using
@Queryandpatternin yourcypher. It will also returnNodeBwithaddressfor those with one address and null address for those withoutaddress.