Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329298 - XmlElementRef to JAXBElement<byte[]> doesn't work with attachments
Summary: XmlElementRef to JAXBElement<byte[]> doesn't work with attachments
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-02 16:20 EDT by Matt MacIvor CLA
Modified: 2022-06-09 10:31 EDT (History)
2 users (show)

See Also:


Attachments
Proposed Fix and Test Case (45.75 KB, patch)
2010-11-18 15:29 EST, Matt MacIvor CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matt MacIvor CLA 2010-11-02 16:20:32 EDT
When processing a property tagged with an XmlElementRef annotation, the EclipseLink MappingsGenerator will create an XmlChoiceObjectMapping. In the case that the target of this XmlElementRef is a JAXBElement<byte[]>, the choice mapping will create an XMLDirectMapping to handle this under the covers. Unfortunately an XMLDirectMapping can only handle inline binary from byte[] and not attachments.

In order to handle attachments in this case XMLChoiceObjectMapping needs to support nested XMLBinaryDataMappings or MappingsGenerator needs to generate a different mapping in this case.
Comment 1 Matt MacIvor CLA 2010-11-18 15:29:32 EST
Created attachment 183422 [details]
Proposed Fix and Test Case
Comment 2 Matt MacIvor CLA 2010-11-18 15:58:49 EST
Proposed fix checked in to SVN
Reviewed by David McCann
Comment 3 Matt MacIvor CLA 2010-11-18 15:59:12 EST
Closing as fixed
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:31:10 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink