Created
March 28, 2017 17:16
-
-
Save n5i/497326674dbbc0e4e474f1882b39c02c to your computer and use it in GitHub Desktop.
Neo4j plugin call whith nested response.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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