0 Replies Latest reply on Sep 8, 2008 1:11 AM by Rigoberto García

    Making a page for Recursive Entity

    Rigoberto García Newbie

      Hi everyone, I have some problems with a Recursive Entity, the situation is that I need a page that manages a hierarchy resources, my main entity class is named RESOURCES, and this entity class will contain tree diferent type of resources, the first type is service, then this service will contain functional services, and one functional service will contain technical services. (this hierarchy may be increase)


      I tried to pass the entire RESOURCE entity trought the page.xml, but I learn that it only accepts simple type values (String, int, etc), then I tried to pass the id from the parent resource to display in the list (ResourceList.xhtml) only the child resources, but I have a problem with this because when I enter to the page in first time, the parent id containts the value 0, and the restriction doesn't found resources with this parent id(because the correct query may contain the restriction resource.parentId is null), also I need to save the whole hierarchy, to make a kind of history inside the page with a menu that makes posible to return a level in the hierarchy....


      So I don't know if there is a solution to manages a Recursive Entity in optimal way, or a best practice to do this kind of process.


      Anybody have some code or knowledge about this to show me the way???? I really apreciete that.....


      Thanks, Rigoberto