Community
Participate
Working Groups
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
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