The change in the element collection is not persisted to the database during
merging a detached entity
------------------------------------------------------------------------------------------------------
Key: OPENJPA-1571
URL: https://issues.apache.org/jira/browse/OPENJPA-1571
Project: OpenJPA
Issue Type: Bug
Affects Versions: 2.1.0
Reporter: Fay Wang
Assignee: Fay Wang
Fix For: 2.1.0
Given an entity:
@Entity
public class EntityB {
@Id
private int id;
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "setIntegerTable", joinColumns = @JoinColumn(name =
"parent_id"))
@Column(name = "value")
private Set<Integer> intVals;
...
}
The following test scenario
EntityB b1 = em.find(EntityB.class, id);
em.clear();
b1.getIntVals().remove(new Integer(1));
b1.getIntVals().add(new Integer(2));
em.getTransaction().begin();
EntityB b2 = em.merge(b1);
em.getTransaction().commit();
em.clear();
EntityB b3 = em.find(EntityB.class, id);
Set<Integer> intVals = b3.getIntVals();
==> this intVals still only contains Integer(1), not Integer(2).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.