Hi Mickey,
There are no repeated child nodes but repeated instances of parents when navigating from bottom to up.
For instance for the following tree if we start from A11 I should be able to retrieve A11,A1,A or if I'm in node A12 I should get A12,A1,A
I've tried a Set but then it creates the constraint where PARENT_ID must be unique (which can't in this tree)
This sample contains only nodes with 2 childs but the actual data contains nodes with multiple childs.
Thanks !
Code:
PKID NODENAME PARENT_ID
=== ======== =======
1 A 0 // this is the root
2 A1 1 // 2nd level in tree, parent is #1, first child
3 A11 2 // 3rd level in tree, parent is #2
4 A2 1 // 2nd level in tree, parent is #1, 2nd child
5v A12 2
In this case the tree is something like this:
A
/ \
A1 A2
/ \
A11 A12