Community
Participate
Working Groups
Build Identifier: I20110519-1138 1. Define type mappings as the following: @Entity public class Phone { @Id private String type; private Integer num; } @Embeddable public class EmbeddableType { @JoinTable(name= "Emp_Phone") <- uses JoinTable strategy @ManyToOne private Phone phone; } @Entity public class Employee { @ElementCollection private Collection<EmbeddableType> emType; } 2. Create a mapping file and add the entity Employee to it 3. Right-click the attribute "emType" of Employee entity in the JPA structure pane and add it to the mapping xml 4. Select phone(Association Override) under Value section in the JPA Deatils view and then select "Override default" checkbox Save the changes and a UnsupportedOperationException will be thrown saying java.lang.UnsupportedOperationException: An element collection containing a nested relationship mapping using a JoinTable is not supported A full stack trace is attached. A couple of things needs to be considered here: 1. If we don't support JoinTable strategy, we should hide association mappings using this strategy from the "Attribute overrides" list or disable the "Override default" checkbox to prevent users from overriding these association mappings. 2. We'd better give users a validation message instead of an exception. Reproducible: Always
Created attachment 196705 [details] Stack Trace
Moving JPA specific bugs to new JPA component in bugzilla.
I have removed the UnsupportedOperationException. Bug 325162 will be used to add the validation for this case.
Created attachment 206269 [details] proposed patch against 3.0 maintenance
Created attachment 206270 [details] proposed patch against 3.0 maintenance
I've attached a patch for fixing this in 3.0.2
fix checked in to maintenance
Verified in Build M-3.3.2-20111117045640 Verified the UnsupportedOperationException does not appear when you check the override default checkbox and Save the project. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.0.2