Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329298

Summary: XmlElementRef to JAXBElement<byte[]> doesn't work with attachments
Product: z_Archived Reporter: Matt MacIvor <matt.macivor>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david.twelves, eclipselink.oxm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Fix and Test Case none

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