How can I get Neo4j OGM to wire up all the POJOs returned from a complex query?

Viewed 371

Say I have a query like this:

START a=node(1), b=node(2) MATCH p=a-[:LINKED_TO*0..]->b 
WITH nodes(p) as pathList UNWIND pathList AS pathNode 
MATCH breakfast=pathNode-[:HAS_A]->(:Bagel) 
RETURN pathList, breakfast

I want a List<Node> corresponding to pathList, and I want each node in that list to have its Bagel defined. I can get an Iterable<Map<String, Object>> from that query which contains all the information, but the POJOs have null fields where ideally they would reference one another.

Is there any way to get the OGM to spit out fully linked domain objects from a query like this?

1 Answers
Related