Annotation Type XmlInverseReference
This annotation is used to map a back-pointer during the unmarshal operation.
When configuring an @XmlInverseReference, the "mappedBy" attribute must
be set to the field on the reference class that maps to this field. For
example:
@XmlRootElement
public class Employee {
...
@XmlElementWrapper(name="phone-numbers")
@XmlElement(name="number")
public List<PhoneNumber> phoneNumbers;
...
}
public class PhoneNumber {
...
@XmlInverseReference(mappedBy="phoneNumbers")
public Employee owningEmployee;
...
}
By default using @XmlInverseReference will make the property act the same as @XmlTransient for the marshal operation. You can make the property writeable by combining it will @XmlElement.
public class PhoneNumber {
...
@XmlInverseReference(mappedBy="phoneNumbers")
@XmlElement
public Employee owningEmployee;
...
}
-
Required Element Summary
-
Element Details
-
mappedBy
String mappedBy
-