Jean-Baptiste,
I realized that in our own in-house "framework to simply to the max the
use of fetchPlan" (just like yours... and ours?) we must be doing the
same, so I refereshed my memories by looking back at that code for you
(written over a year ago) and suddenly remembered that indeed there is a
little "trick", you have to:
fp.removeFetchGroup(FetchGroup.NAME_DEFAULT);
Because (quote from doc) "any field that is eagerly loaded according to
the JPA metadata rules into the built-in default fetch group. As its
name implies, the default fetch group is active by default. You may also
define your own..."
Does this help? If yes, why don't you create a little Defect suggest
that the documentation be slightly slightly improved to take this
crystal clear? Once you know it I guess the phrase above is clear, but
if you don't, it's probably not clear enough? A few lines of example &
explanation may have helped you?
> Magazine mag = em.find(Magazine.class, magId);
> Will it work also with a query and not only with the find(id) method ?
> Something like that : em.createQuery("SELECT blablabla ..."); ??
Yes yes of course. Make sure you also read & understand the
http://openjpa.apache.org/builds/1.2.1/apache-openjpa-1.2.1/docs/manual/
ref_guide_perfpack_eager.html stuff though.
Ciao.