I'm using neo4j-ogm 3.1.5 in my project.
In my code, when I'm fetching any relationship entity with depth = 1
, it is fetching startNode and endNode and it is also fetching relationships of startNode and endNode. Basically, it the depth parameter is working as depth = depth + 1
, because the same value of depth is passed to the nodes when fetching relationship entity.
AFAIK understand depth parameter is used basically like a hibernate's LAZY or EAGER loading.
In SchemaRelationshipLoadClauseBuilder
class, its happening in the method
public String build(String variable, String label, int depth)
Steps to Reproduce
Fetch a relationship entity using findById
method
Current Implementation
In SchemaRelationshipLoadClauseBuilder
, the following method:
public String build(String variable, String label, int depth)
- calls
expand(sb, "n", start, depth)
instead ofexpand(sb, "n", start, depth-1)
, AND - calls
expand(sb, "m", end, depth)
instead ofexpand(sb, "m", end, depth-1)
.
The thing is, this will cause a problem in my project, as the startNode and endNode of the respective relationship entity can have more than 100 000 relationships of the same kind and fetching all those relationships will take up the memory of the machine.
Can anyone explain why is it so?