Hi Stephen,
FetchPlan.removeField(A.class, "fieldA") acts to remove the fieldA *if* it
were previously added to the plan. It does not nothing if fieldA were not
added explicitly to the plan. In that sense, FetchPlan.removeField() does
*not* mean "exclude fieldA from being fetched". I think this is weak
semantically and usage-wise.
Given that, to support your use case is somewhat tricky. A poor suggestion
is to define a named fetch group X (on the base class that declared the
'eager' field ) such that X does not include the eager field and use it as
EntityManager em = ...;
FetchPlan plan = OpenJPAPersistence.cast(em).getFetchPlan();
plan.addFetchGroup("X");
// do something such as query of find with em
-----
Pinaki
--
View this message in context:
http://openjpa.208410.n2.nabble.com/subclass-lazy-fetching-tp5718725p5738585.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.