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

Bug 331234

Summary: xml-mapping-metadata-complete overriden by metadata-complete specification
Product: z_Archived Reporter: Guy Pelletier <guy.pelletier>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.orm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed changes
none
Updated patch (missed adding some new files)
none
Updated patch 2 (missed adding more new files) none

Description Guy Pelletier CLA 2010-11-26 14:15:58 EST
When an xml-mapping-metadata-complete flag is set, all entities across the persistence unit should be metadata-complete and any metadata-complete=false from an entity, embeddable or mapped superclass should be ignored.

This is written in the spec, section 11.1

"If xml-mapping-metadata-complete is specified and XML elements are omitted, the default values apply. These default values are the same as the corresponding defaults when annotations are used, except in the cases specified in Section 11.2 below. When the xml-mapping-metadata-complete element is specified, any metadata-complete attributes specified within the entity, mapped-superclass, and embeddable elements are ignored."

Example:

<persistence-unit-metadata>
  <xml-mapping-metadata-complete/>
</persistence-unit-metadata>

<entity class="Hammer" metadata-complete="false">
  <attributes>
    <id name="id">
      <column name="ID"/>
      <generated-value/>
    </id>
  </attributes>
</entity>

public class Hammer extends Tool {    
    public int id;
    
    // ===>> This column name should not get picked up and should default to color.
    @Column(name="IGNORED_COLOR")
    public String color;
    
    public Hammer() {}    
}
Comment 1 Guy Pelletier CLA 2010-11-30 14:52:03 EST
Created attachment 184178 [details]
Proposed changes
Comment 2 Guy Pelletier CLA 2010-12-01 08:38:32 EST
Created attachment 184252 [details]
Updated patch (missed adding some new files)
Comment 3 Guy Pelletier CLA 2010-12-01 08:53:37 EST
Created attachment 184256 [details]
Updated patch 2 (missed adding more new files)
Comment 4 Guy Pelletier CLA 2010-12-01 09:28:05 EST
Changes have been submitted.

Reviewed by: Tom Ware

Tests: New test suite (EntityMappingsMetadataCompleteJUnitTestCase) added. New test model (jpa/xml/metadatacomplete).
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:27:55 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink