Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331234 - xml-mapping-metadata-complete overriden by metadata-complete specification
Summary: xml-mapping-metadata-complete overriden by metadata-complete specification
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-26 14:15 EST by Guy Pelletier CLA
Modified: 2022-06-09 10:27 EDT (History)
1 user (show)

See Also:


Attachments
Proposed changes (81.55 KB, patch)
2010-11-30 14:52 EST, Guy Pelletier CLA
no flags Details | Diff
Updated patch (missed adding some new files) (89.68 KB, patch)
2010-12-01 08:38 EST, Guy Pelletier CLA
no flags Details | Diff
Updated patch 2 (missed adding more new files) (103.04 KB, patch)
2010-12-01 08:53 EST, Guy Pelletier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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