Oops sorry, I think I found a solution to my question. Support for removing an
embeddable exists through the FetchPlan API itself (especially since
https://issues.apache.org/jira/browse/OPENJPA-1486 is fixed?).
I solved my problem by doing:
FetchPlan fetchPlan = entityManager.getFetchPlan();
fetchPlan.removeField(Department.class, "address");
fetchPlan.removeField(Department.class, "alternativeAddress");
The drawback of this is that you have to repeat this code each time you fetch a
Department; it does not become part of any @FetchGroup configuration on the
entity itself.
-----Oorspronkelijk bericht-----
Van: Henno Vermeulen [mailto:[email protected]]
Verzonden: woensdag 11 mei 2011 14:44
Aan: '[email protected]'
Onderwerp: lazy fetch @Embedded
I am using fetch plans and I can lazy fetch individual attributes with
@Basic(fetch = FetchType.LAZY), but now I have an entity with an embeddable
which must sometimes be lazy fetched.
Is it possible to lazy fetch an embeddable without having to annotate each of
the embeddable's attributes with @Basic(fetch = FetchType.LAZY)?
Regards,
Henno Vermeulen