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

Bug 339381

Summary: Enhancement: XML Extensions
Product: z_Archived Reporter: Blaise Doughan <blaise.doughan>
Component: EclipselinkAssignee: Rick Barkhouse <rick.barkhouse>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipselink.oxm-inbox, rick.barkhouse
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
URL: http://wiki.eclipse.org/EclipseLink/Development/339381
Whiteboard:
Bug Depends on: 341653, 341658, 341659, 342990, 342991    
Bug Blocks: 339371, 348103    
Attachments:
Description Flags
Phase 1 code changes
none
Phase 1 test changes
none
Phase 1 xsd changes
none
Phase 1 code changes
none
Phase 1 test changes
none
Phase 1 code changes
none
Phase 1 test changes none

Description Blaise Doughan CLA 2011-03-09 10:58:54 EST
Currently MOXy supports the mapping of fields/properties to XML.  This extension would extend this ability to entries of a Map.  The API might look something like the following:

    @XmlRootElement
    public class Customer {

        @XmlAttribute
        private String name;

        @XmlExtensions
        private Map<String, Object>

    }

If the user want to create a mapping for "age", then could configure it using MOXy's XML metadata.  When the metadata is processed MOXy would recognize that the corresponding field did not exist and configure the mapping (accessor) to participate in the extensions Map.
Comment 1 Blaise Doughan CLA 2011-03-09 11:20:14 EST
Design Consideration:
Care should be taken when designing this feature so that the implementation remains consistent with the implementation of DynamicEntity.  For example one could think of a DynamicEntity consisting of nothing but flex fields.
Comment 2 Blaise Doughan CLA 2011-03-09 11:27:48 EST
Design Consideration:
The map used to store flex data by MOXy, could also be the map used to store flex data by the ORM component.
Comment 3 Blaise Doughan CLA 2011-03-09 11:36:42 EST
Design Consideration:
Should the map be allowed to store unmapped fields?  Some reasons to allow this includes:
1. A valid flex field in ORM may not be a valid flex field in MOXy.  
2. The map may be populated before the extension is configured in the runtime metadata.
Comment 4 Rick Barkhouse CLA 2011-04-01 16:33:17 EDT
Created attachment 192386 [details]
Phase 1 code changes
Comment 5 Rick Barkhouse CLA 2011-04-01 16:34:06 EDT
Created attachment 192387 [details]
Phase 1 test changes
Comment 6 Rick Barkhouse CLA 2011-04-01 16:34:46 EDT
Phase 1

Support for:

    * Direct mapping
    * Composite Object mapping
    * Composite Collection mapping
    * XML Join Nodes
    * IDREF mapping
    * xml-list
    * Any Element mapping
Comment 7 Rick Barkhouse CLA 2011-04-01 17:06:01 EDT
Created attachment 192390 [details]
Phase 1 xsd changes
Comment 8 Rick Barkhouse CLA 2011-04-14 13:34:10 EDT
Created attachment 193277 [details]
Phase 1 code changes
Comment 9 Rick Barkhouse CLA 2011-04-14 13:34:33 EDT
Created attachment 193278 [details]
Phase 1 test changes
Comment 10 Rick Barkhouse CLA 2011-04-18 15:58:34 EDT
Created attachment 193525 [details]
Phase 1 code changes
Comment 11 Rick Barkhouse CLA 2011-04-18 15:58:57 EDT
Created attachment 193526 [details]
Phase 1 test changes
Comment 12 Rick Barkhouse CLA 2011-05-16 10:51:01 EDT
Feature complete for 2.3
Comment 13 Eclipse Webmaster CLA 2022-06-09 10:09:32 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink