| Summary: | Removing an element from the middle of a @ElementCollection with @OrderColumn hangs up EclipseLink | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Igor Mukhin <iimuhin> | ||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P2 | CC: | andrei.ilitchev, eclipselink.orm-inbox, michael.f.obrien, tom.ware | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Setting target and priority. See the following page for information about what these settings mean: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Created attachment 179544 [details]
Suggested patch.
Trivial fix in AggregateCollectionMapping.
Added testDeleteMiddleRecordOfExpertBeerConsumer to InheritedModelJunitTest.
Checked the fix into both trunk (2.2.) and 2.1.2 The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
Build Identifier: 2.1 Removing an element from the middle (not first, not last) of a @ElementCollection with @OrderColumn hangs up EclipseLink. Reproducible: Always Steps to Reproduce: 1. Create entititeies @Entity public class Person { @Id @GeneratedValue(strategy=GenerationType.TABLE) private int id; @Basic private String name; @ElementCollection @CollectionTable( name="PERSON_LOGIN", joinColumns=@JoinColumn(name="PERS_ID", referencedColumnName="ID") ) @OrderColumn(name="ORDER_COL") private List<PersonLogin> logins = new Vector<PersonLogin>(); //... } @Embeddable public class PersonLogin { @Basic private String username; @Basic private String password; //... } 2. Add the person Person p = new Person(); p.setName("Igor"); p.getLogins().add(new PersonLogin("igor1", null, 4)); p.getLogins().add(new PersonLogin("igor2", "pass2", 3)); p.getLogins().add(new PersonLogin("igor3", "pass3", 2)); p.getLogins().add(new PersonLogin("igor4", "pass4", 1)); logStep("inserting new person..."); em.getTransaction().begin(); em.persist(p); em.getTransaction().commit(); 3. Remove an element from the middle (not first, not last) will cause EclipseLink to hang up. em.getTransaction().begin(); p.getLogins().remove(1); em.getTransaction().commit(); // it will hang up here