I have hierarchy of data as below. I want to retrieve all unique nodes from database without making multiple recursive calls to database? I am looking for something similar to Common Table Expression in SQL. I think OQL doesn't support CTEs, want to check if there is any better way to retrieve all the data without making multiple database calls
Mohan Reddy Kathireddy
Having Root, then doing a retrieve over association will get you all Nodes and they will be unique.
Tim van Steenbergen
If you have unlimited depth then then I do not think you can do it. And with a known depth you get a lot of or statements in your XPath. Using multiple calls and combining the list would be faster imho. And you can stop the next call if there is no longer a node below it.