This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 339381 - Enhancement: XML Extensions
Summary: Enhancement: XML Extensions
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Rick Barkhouse CLA
QA Contact:
URL: http://wiki.eclipse.org/EclipseLink/D...
Whiteboard:
Keywords:
Depends on: 341653 341658 341659 342990 342991
Blocks: 339371 348103
  Show dependency tree
 
Reported: 2011-03-09 10:58 EST by Blaise Doughan CLA
Modified: 2022-06-09 10:09 EDT (History)
2 users (show)

See Also:


Attachments
Phase 1 code changes (18.20 KB, patch)
2011-04-01 16:33 EDT, Rick Barkhouse CLA
no flags Details | Diff
Phase 1 test changes (26.29 KB, patch)
2011-04-01 16:34 EDT, Rick Barkhouse CLA
no flags Details | Diff
Phase 1 xsd changes (649 bytes, patch)
2011-04-01 17:06 EDT, Rick Barkhouse CLA
no flags Details | Diff
Phase 1 code changes (19.65 KB, patch)
2011-04-14 13:34 EDT, Rick Barkhouse CLA
no flags Details | Diff
Phase 1 test changes (29.21 KB, patch)
2011-04-14 13:34 EDT, Rick Barkhouse CLA
no flags Details | Diff
Phase 1 code changes (16.83 KB, patch)
2011-04-18 15:58 EDT, Rick Barkhouse CLA
no flags Details | Diff
Phase 1 test changes (30.65 KB, patch)
2011-04-18 15:58 EDT, Rick Barkhouse CLA
no flags Details | Diff

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