I am trying to get all the parents and its children objects from an object. I need to basically keep travelling through it from a single object i have. so..


object has:
=====
entities


I need to go through the object's entities, and its entities etc.... until it gets to the root entity of the object, then work its way downwards because I need to check for uniqueness of an entity

how can I do this using recursion?