Bug 275374 - XML DirectCollectionMapping should support lists of lists
Summary: XML DirectCollectionMapping should support lists of lists
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: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: Documentation
Depends on:
Blocks:
 
Reported: 2009-05-07 16:25 EDT by Rick Barkhouse CLA
Modified: 2022-06-09 10:23 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch - calling ConvMgr directly (33.74 KB, patch)
2009-05-12 14:09 EDT, Rick Barkhouse CLA
no flags Details | Diff
Final patch - using XMLListConverter (33.70 KB, patch)
2009-05-13 16:03 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 Rick Barkhouse CLA 2009-05-07 16:25:13 EDT
Support should be added to MOXy to map a list of lists using a DirectCollectionMapping.  Example:

Object:

public class Root {
  public ArrayList<ArrayList<Double>> items = new ArrayList<ArrayList<Double>>();
}

XML:

<root>
    <item>1.2 3.4 5.6</item>
    <item>-7.8 -9.0 -1.2</item>
</root>
Comment 1 Rick Barkhouse CLA 2009-05-12 14:09:13 EDT
Created attachment 135408 [details]
Proposed patch - calling ConvMgr directly
Comment 2 Rick Barkhouse CLA 2009-05-13 16:03:15 EDT
Created attachment 135671 [details]
Final patch - using XMLListConverter
Comment 3 Rick Barkhouse CLA 2009-05-13 16:20:44 EDT
Fixed, reviewed by bdoughan.

The user can now use the new XMLListConverter for this type of mapping:

XMLCompositeDirectCollectionMapping itemsMapping = new
   XMLCompositeDirectCollectionMapping();
itemsMapping.setAttributeName("items");
itemsMapping.setXPath("item/text()");
itemsMapping.setFieldElementClass(ArrayList.class);
itemsMapping.useCollectionClass(ArrayList.class);

XMLListConverter listConverter = new XMLListConverter();
listConverter.setObjectClass(Double.class);
itemsMapping.setValueConverter(listConverter);
Comment 4 Neil Hauge CLA 2009-07-29 14:10:49 EDT
What release is/was this feature targeted for?
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:15:56 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:23:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink