Tree + JPA

I am a total beginner so I’m not sure if this is possible, but I have a JPAContainer returning a list of “ObjectA” which link to “Objectb”'s. I would like to link this to a Tree so that the structure shows

  • ObjectA 1
    • ObjectB 1.1
  • ObjectA 2
    • ObjectB 2.1
    • ObjectB 2.2

public class ObjectA{
List objectbs;
How would I go about implementing this tree structure in the most efficient way?
Many Thanks,

in this situation, you have to make a HierarchicalContainer manually, and set childrens for any parents.

but if you have structure like this:

  • ObjectA 1
    • ObjectA 1.1
    • ObjectA 1.2

you may set parent property, for example:


Thanks for your response, that was what I was expecting but really helpful to have it confirmed!