posted 13 years ago
I have a group of object, each object knows it’s ID and it’s parent ID (if it has one).
I have a method call that will return a List of objects based on a parent ID.
public List<MyRecords> getChildRecords(Long recordID)…
what I need to do is create a method that will return all the objects after I have gotten the root object. I would like to do this recursively.
And in case you are wondering, no this isn’t a class assignment or anything. It is just that looking at the problem I am thinking it would probably be a good example of where to do recursion but I just can’t wrap my head around it right now.
Thanks