Community
Participate
Working Groups
When trying to create a JAXB Context using the class below: public class Employee { @XmlID @XmlAttribute public Integer id; @XmlKey @XmlAttribute public String name; @XmlJoinNodes( { @XmlJoinNode(xmlPath = "manager/@id", referencedXmlPath = "@id"), @XmlJoinNode(xmlPath = "manager/@name", referencedXmlPath = "@name") }) public Employee manager; @XmlJoinNodes( { @XmlJoinNode(xmlPath = "report/@id", referencedXmlPath = "@id"), @XmlJoinNode(xmlPath = "report/@name", referencedXmlPath = "@name") }) public List<Employee> reports = new ArrayList<Employee>(); } EclipseLink throws the following exception: Exception Description: Property [manager] in class [documentation.Employee] has an XmlJoinNode declaration with referencedXmlPath [@id], but there is no XmlID or XmlKey property on the target class [documentation.Employee] with the XmlPath [@id]. It is required that there is an XmlID/XmlKey property with a matching XmlPath on the target class for each referencedXmlPath. Adding a redundant @XmlPath annotation solves the problem but the user should not be forced to do this, because the XPath is implied by using @XmlAttribute.
This problem exists when using both annotations and OXM.
Correction: This problem exists when using *either* annotations or OXM.
Created attachment 195606 [details] proposed fix and modified test
Attached patch checked in to SVN
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink