Community
Participate
Working Groups
Build Identifier: I20101028-1441 Every time map an attribute of an EclipseLink mapping file as id mapping, the enumerated element is automatically added for the mapping, like <id name="foo_id"> <enumerated>ORDINAL</enumerated> </id> The enumerated element does not apply to id mapping. The problem only exists with the EclipseLink mapping file. Reproducible: Always Steps to Reproduce: 1. Create an EclipseLink mapping file 2. Add an attribute to the mapping file and map it as ID mapping
Created attachment 188098 [details] Patch
Looks good. Enumerated didn't belong there, as you mentioned. Patch committed to head.
I should have looked at this sooner. enumerated is supported on id mappings, but only in the eclipselink 2.2 orm schema. The resource model is written in such a way that the translators are for the latest version of the schema, shouldn't hurt to have extra translators for things that won't ever appear in the file. The real solution here is in o.e.jpt.core.resource.orm.XmlId the static file ENUMERATED_EDEFAULT needs to be changed to the following. We have to change what EMF has generated and make sure it doesn't regenerate over it by removing the @generated javadoc. You can see the same thing being done in o.e.jpt.core.resource.orm.XmlBasic /** * changed this to null and removed the generated flag so emf won't generate over * it we don't want a default for enums, just null if the tag does not exist */ protected static final EnumType ENUMERATED_EDEFAULT = null;
Created attachment 188281 [details] Patch Integrated the comment and tested
I have checked this patch in for 3.0M6
Verified in Build I-3.3.0-20110414085808 Verified when you add an ID mapped attribute to eclipselink-orm mapping file the <enumerated> tag does not appear in the Source. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.0_M6