Hello all,
I'm having trouble using EntityManger.merge() operation...
I have a entity A that holds a many-to-one reference to another, B. On
entity A, the relationship is annotated like this:
@ManyToOne(fetch=FetchType.EAGER, cascade=CascadeType.MERGE)
At a certain point in processing, I've got a detached instance of A
referencing an instance of B.
I want to dissociate A from any instance of B. So I call:
a.setB(null);
while A is detached, and then call:
merge(a)
I thought the merge() operation would discover the change and update A
in the database, but it does not.
Is my mental model wrong?
Do I have to (or *can* I) mark A as "dirty" to get OpenJPA to notice it?
Thanks in advance,
--Rich