Skip to main content
Jump to: navigation, search


< EclipseLink‎ | DesignDocs‎ | 293925‎ | MOXyExtensions
Revision as of 09:56, 31 March 2010 by (Talk | contribs) (New page: <div style="border: 1px solid rgb(0, 0, 0); margin: 5px; padding: 5px; float: right;">__TOC__</div> = XMLCollectionReferenceMapping = == Requirements == Provide support for XML collectio...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)



Provide support for XML collection reference mapping configuration via XML metadata file.

The following should be configurable:


Basic XML collection reference mapping support

We will extend our current xml-element and xml-attribute support to allow collection reference mapping configuration. For example, the following XML metadata snippet would be used to setup a collection reference mapping for 'workAddresses':

<xml-element java-attribute="workAddresses" xml-path="contact-info/work-address-id/text()" xml-idref="true" />

Where the following exists in Address:

<xml-attribute java-attribute="id" xml-id="true" required="true" />

If workAddresses was to be mapped to an element named work-address-id, then the following would be used:

<xml-element java-attribute="workAddresses" xml-path="work-address-id/text()" xml-idref="true" />

Where the following exists in Address:

<xml-attribute java-attribute="id" xml-id="true" required="true" />


The following example will demonstrate how to configure XML collection reference mappings via XML metadata by using xml-element and xml-attribute.

package org.example;
public class Root {
    public List<Employee> employees;
    public List<Address> addresses;

package org.example;
public class Employee {
    public List<Address> workAddresses;

package org.example;
public class Address {
    public String id;

Deployment XML


XML Instance Document

<?xml version='1.0' encoding='UTF-8'?>
        <address aid="100" />
        <address aid="101" />
        <address aid="102" />


This XML file demonstrates configuring XML collection reference mappings on the "org.example.Employee" class.

<?xml version="1.0" encoding="US-ASCII"?>
<xml-bindings xmlns="">
        <java-type name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.mappings.collectionreference.Root">
            <xml-root-element name="document-root" />
                <xml-element java-attribute="employees" xml-path="employee" />
                <xml-element java-attribute="addresses" xml-path="addresses/address" />
        <java-type name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.mappings.collectionreference.Employee">
                <xml-element java-attribute="workAddresses" xml-path="contact-info/work-address-id/text()" xml-idref="true" />
        <java-type name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.mappings.collectionreference.Address">
                <xml-attribute java-attribute="id" xml-path="@aid" xml-id="true" required="true" />

Open Issues

This section lists the open issues that are still pending that must be decided prior to fully implementing this project's requirements.

Issue# Owner Description/Notes


This section lists decisions made. These are intended to document the resolution of open issues or constraints added to the project that are important.

Issue# Description/Notes Decision

Back to the top