> Wow, that fetchPlan API is just far more powerful than I thought. That is good to know :)
Jean-Baptiste BRIAUD -- Novlog wrote: > > HI Craig, > > Wow, that fetchPlan API is just far more powerful than I thought. I'll > have to dig that, I'm sure our OpenJPA layer need improvements :-) > > OpenJPA really rocks ! > > On Dec 7, 2009, at 22:59 , Craig L Russell wrote: > >> >> On Dec 7, 2009, at 1:44 PM, Jean-Baptiste BRIAUD -- Novlog wrote: >> >>> How do you do that ? >>> >>> I'm using a new EM for one client-server network request but even in one >>> client-server network request there may be several database request, so >>> I would be interested to know how to you set a fetch plan for one >>> request only. >> >> There is a fetch plan for the em that can be modified. Subsequent >> operations use the modified fetch plan. >> >> There is a fetch plan for a query that is initialized to the fetch plan >> for the em at the time you create the query. The fetch plan for the query >> can be modified and it only affects that query. >> >> If you want to modify the fetch plan for a series of queries and then >> revert the fetch plan, take a look at OpenJPAEntityManager.pushFetchPlan >> and popFetchPlan. >> >> Craig >>> >>> On Dec 7, 2009, at 22:13 , Daryl Stultz wrote: >>> >>>> On Mon, Dec 7, 2009 at 3:48 PM, Jean-Baptiste BRIAUD -- Novlog < >>>> [email protected]> wrote: >>>> >>>>> Now, thanks to you, I'm doing the following : >>>>> final FetchPlan fetchPlan = entityManager.getFetchPlan(); >>>>> fetchPlan.clearFetchGroups(); >>>>> fetchPlan.clearFields(); >>>>> fetchPlan.removeFetchGroup(FetchGroup.NAME_DEFAULT); >>>>> >>>>> >>>> FWIW, if you don't know already, modifying the fetch plan at the EM >>>> level >>>> affects all subsequent queries. You can also modify the fetch plan for >>>> individual queries. >>>> >>>> -- >>>> Daryl Stultz >>>> _____________________________________ >>>> 6 Degrees Software and Consulting, Inc. >>>> http://www.6degrees.com >>>> mailto:[email protected] >>> >> >> Craig L Russell >> Architect, Sun Java Enterprise System http://db.apache.org/jdo >> 408 276-5638 mailto:[email protected] >> P.S. A good JDO? O, Gasp! >> > > > ----- Pinaki -- View this message in context: http://n2.nabble.com/Fetch-plan-question-tp4117231p4143547.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
