Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » XmlPath Issue with MOXy 2.6.0
icon5.gif  XmlPath Issue with MOXy 2.6.0 [message #1747921] Wed, 16 November 2016 19:05
M. H. is currently offline M. H.Friend
Messages: 1
Registered: November 2016
Junior Member
Hello,

I am having some trouble with MOXy 2.6.0.
The following simplified scenario worked in 2.5.0 and 2.5.2 :
Customer class: (extract)
	@XmlPath("personal-info/name/text()")
	private String name;

	@XmlPath("contact-info/phone-number[@id='work']")
	private CustomObject workNumber;
	
	@XmlPath("contact-info/phone-number[@id='fax']")
	private CustomObject faxNumber;

	@XmlPath("contact-info/phone-number[@id='other']")
	private CustomObject otherNumber;
	
	@XmlPath("contact-info/phone-number")
	private List<CustomObject> numbers;


XML:
<?xml version="1.0" encoding="UTF-8"?>
<customer>
   <personal-info>
      <name>Jane Doe</name>
   </personal-info>
   <contact-info>
      <phone-number id="work">613-555-1111</phone-number>
      <phone-number id="cell">613-555-2222</phone-number>
      <phone-number id="fax">613-555-3333</phone-number>
	  <phone-number id="pager">613-555-4444</phone-number>
      <phone-number id="other">000000</phone-number>
   </contact-info>
</customer>


Expected behaviour:
name=Jane Doe
workNumber= 613-555-1111
faxNumber= 613-555-3333
otherNumber=000000
getNumbers={work,cell,fax, pager, other}


In Version 2.5 this was working perfectly. After updating the Maven dependency to 2.6.0 / 2.6.2 the behaviour is as follows:
name=Jane Doe
workNumber= 613-555-1111
faxNumber= null
otherNumber=null
getNumbers={work,cell,fax, pager, other}


removing the getNumbers mapping from code:
name=Jane Doe
workNumber= 613-555-1111
faxNumber= 613-555-3333
otherNumber=000000


adding a mapping for cell, then:
name=Jane Doe
workNumber= 613-555-1111
cellNumber= 613-555-2222
faxNumber= 613-555-3333
otherNumber=null
getNumbers={work,cell,fax, pager, other}


So, somehow when the ElementWrapper is mapped, other direct mapped Sub-Elements only work until the unmarshaller hits a Element that is not mapped.
Please enlighten me, if this is supposed to happen or if it is a bug / mistake by myself.

Thanks and best regards,
M.H.
Previous Topic:Many databases, same shared schema. One EntityManagerFactory?
Next Topic:Correct usage of Java EntityManager
Goto Forum:
  


Current Time: Mon Dec 11 04:01:12 GMT 2017

Powered by FUDForum. Page generated in 0.01893 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software