Am I correct to be using a session bean to gather a collection of child
EJB objects?
What I'm trying to avoid is this case where I created a simple findAll() EJB query that returns a collection of child entities. The problem is that when I get my collection and begin to walk through it, it is doing a subsequent database connection for *each* element as it renders it on screen. So, instead of doing 1 database fetch for the object and all it's children, I'm doing N trips to the database where N is the number of child EJB entity references.
Can I use a session bean to get them all at once and return them as a
unit? Or am I simply using the
pattern wrong and there is a better/more correct way to work with an entity and it's children?