| Summary: | Enhancement: Updates to a value in an element collection map keyed by entity results in delete/insert instead of an update. | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Vikram Bhatia <vikram.jeet.bhatia> |
| Component: | Eclipselink | Assignee: | Project Inbox <eclipselink.orm-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | gabriel, martin.grebac |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
ElementCollection Map of basic values keyed by entity. Updating a value of a Map entry seems to be causing EL to remove the old row in the collection table and insert a new one with the new value instead of updating it in the collection table. Example of model: @Entity public class Department { @Id private int id; @ElementCollection @CollectionTable(name="EMP_SENIORITY") @MapKeyJoinColumn(name="EMP_ID") @Column(name="SENIORITY") private Map<Employee, Integer> seniorities; ... } Code example: myDept.getSeniorities().put(newEmp, 1); ... myDept.getSeniorities().put(newEmp, 2); When modifying the value, the second put() will cause the row in EMP_SENIORITY table to be removed and a new one to be inserted in the collection table. Bug 364248 reports two problems. First one has been fixed. However, the other is a performance enhancement.