Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 259381

Summary: Eclipselink java mapping overriden in orm.xml file does not work
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JPAAssignee: Neil Hauge <neil.hauge>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: neil.hauge
Version: 2.1   
Target Milestone: 3.4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 392222    
Bug Blocks:    

Description Karen Butzke CLA 2008-12-19 10:27:55 EST
Create a JPA project with the EclipseLink platform chosen, leave the create orm.xml file checkbox checked.  You will the eclipselink java on your build path.

Create a java class and add an attribute with the org.eclipse.persistence.annotations.BasicCollection annotation:

@Entity
public class Foo {
	@BasicCollection
	private Collection<String> bars;
}

In the orm.xml file, view the JPA structure and select the bars attribute.  An exception is thrown in the error log:

java.lang.IllegalArgumentException: Unsupported attribute mapping UI provider key:
at org.eclipse.jpt.ui.internal.details.PersistentAttributeDetailsPage.getAttributeMappingUiProvider(PersistentAttributeDetailsPage.java:77)


This same problem could occur when we support the JPA 2.0 spec and allow a JPA 1.0 orm.xml file with the 2.0 faceted project.
Comment 1 Karen Butzke CLA 2009-05-20 09:44:22 EDT
I am unsure how to handle this case, but I don't see it being a simple change, targeting to future
Comment 2 Neil Hauge CLA 2011-07-01 16:26:10 EDT
Moving JPA specific bugs to new JPA component in bugzilla.
Comment 3 Neil Hauge CLA 2011-07-22 10:15:51 EDT
This issue came up in a recent meeting while discussing metadata conversion.  It was decided that we should try to gently avoid the use of generic orm.xml in EclipseLink projects.  This could be done by generating EclipseLink orm.xml files by default in project creation (when requested by the user) and guiding the user to create eclipselink orm.xml files in the UI when EclipseLink platform is in use.

This won't "fix" this problem, but should help avoid this situation.  Another thing we could do would be to place a warning on a mapping file any time when lower level metadata may not be supported, whether it is platform related or version related.  This could be done in addition to the changes mentioned above.  Another possibility would be to restrict a user from attempting to override metadata that it cannot override.  Perhaps you would still see a virtual mapping, but the context menu and details actions would be disabled.
Comment 4 Neil Hauge CLA 2011-10-07 12:51:48 EDT
Targeting to Juno release.
Comment 5 Neil Hauge CLA 2013-04-15 23:28:53 EDT
Given that bug 392222 has been fixed, this bug is possibly lower in severity.  It would be nice to do more, but moving that effort to 3.4 at this point.
Comment 6 Neil Hauge CLA 2013-09-04 15:12:56 EDT
Not likely that we will do more here.