-
1. Re: fetch type eager
mazz Apr 7, 2006 8:29 AM (in response to doubledenim)I believe you will need to rethink the way you are doing things.
You'll probably want to use LAZY fetching most of the time and utilize EJBQL to eagerly fetch things you know you'll want to fetch.
This requires you to create session beans (call them DAO's if you want, or call them FooBar Beans, whatever, I won't get into the DAO discussion again :-) and those session beans would provide methods that eagerly load your entities for the use-cases in which you need eager loading (by performing EJBQL queries that do your inner joins to eagerly fetch the child relationship data).
IMO, eager loading should be used very minimally and only in those cases when you ALWAYS want to populate your relationship objects.
I'd be curious to hear others opinions on this - as I in no way consider myself an EJB3 guru. -
2. Re: fetch type eager
ejb3workshop Apr 7, 2006 8:54 PM (in response to doubledenim)You need to rethink. EAGER should be used for Composition relationships and certain exceptional cases where the contained object is always needed. Also take a look at the FETCH attribute of the EQL language.