Skip to content

Instantly share code, notes, and snippets.

@n5i
Created March 28, 2017 17:16
Show Gist options
  • Save n5i/497326674dbbc0e4e474f1882b39c02c to your computer and use it in GitHub Desktop.
Save n5i/497326674dbbc0e4e474f1882b39c02c to your computer and use it in GitHub Desktop.
Neo4j plugin call whith nested response.
@Procedure("test.nested")
public Stream<NestedReport> testNested()
{
ArrayList<NestedReport> res = new ArrayList<>();
NestedReport grandParent = new NestedReport("Grandparent");
NestedReport parent = new NestedReport("Parent");
NestedReport child = new NestedReport("Child");
NestedReport grandchild = new NestedReport("Grandchild");
child.addSebreport(grandchild);
parent.addSebreport(child);
grandParent.addSebreport(parent);
res.add(grandParent);
return res.stream();
}
public class NestedReport{
public String Name;
public List<Object> Subreports;
public NestedReport(String name){
Name = name;
Subreports = new ArrayList<>();
}
public void addSebreport(NestedReport subreport){
Subreports.add(subreport);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment