I tested with this piece of code and it works:
//modified is the instance client had changed
Record modified = (Record) processClientRequest();
EntityManager em = emf.createEntityManager();
Record merged = (Record) em.merge(modified);
//assume begin is a date and client set the date to null, updat
Oh wow thank you for your elaborate help, I feel kind of bad for taking your
time because I already fixed my problem using native queries.
I'll record this help in case we need something similar in the future or when I
need to adjust my code and native queries become less maintainable.
Regards,
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
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.ge
Sorry, my problem is not yet solved. FetchPlan.removeField seems to only work
for fields that were explicitly added and not for fields that are in the
default fetchgroup. My guess is that the system cannot handle explicitly
overriding individual eager fetched to become lazy. Is this true?
The o
Pinaki,
Thanks for the reply. My original post was a typo. the method as executed is
actually
public void setAddress(Addresses address) {
this.address = address;
}
My distribution policy is consulted first when persisting the Person object.
And then again when it persists the Addresses ob