[jboss-user] [EJB 3.0] - Re: Properly using a OneToMany relationship using EJB 3.0

mazz@jboss.com do-not-reply at jboss.com
Mon Jun 18 08:35:03 EDT 2007


Problem with that second solution is that it leads to the N+1 problem.

There is a third solution - use LEFT JOIN FETCH.

If you have a collection that is configure for lazy loading, you can execute a JPQL query that left join fetches the collection you want to eagerly load.  There is plenty of info on the net about left join fetches if you want to learn more.

All of these solutions mentioned in this thread are not hibernate specific.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055198#4055198

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055198



More information about the jboss-user mailing list