Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Specifying Collection Type in OXM

Hi all,

In EclipseLink OXM we currently have the ability to specify the Java type of an element, attribute, etc., but there is no way to specify what Collection type (if any) is being used.  For example, the following is currently supported:
Java: private java.lang.Integer zipCode;
OXM:  <xml-element java-attribute="zipCode" type="java.lang.Integer"/>

But the following is not:
Java: private java.util.List<java.lang.Integer> zipCodes;

This is needed for Dynamic JAXB -- because there is no Java class behind the scenes, we must depend exclusively on the OXM for all of the necessary information in order to build the dynamic type.

Dave M has put together a wiki page for this issue at:

http://wiki.eclipse.org/EclipseLink/DesignDocs/322284

I think the only real point of contention would be what we call this attribute.  JPA uses "attribute-type", but we feel this would be confusing as we already have an attribute called "type".  I would propose that we add a "collection-type" attribute to the following OXM tags:

<xml-element>
<xml-elements>
<xml-any-element>

e.g.
<xml-element java-attribute="zipCodes" type="java.lang.Integer" collection-type="java.util.List"/>

Thoughts?

--
Rick Barkhouse | Software Developer, EclipseLink | 613.288.4613
Oracle Development
45 O'Connor Street, Suite 400 | Ottawa, Ontario K1P 1A4

Back to the top