Top Description Methods
org.eclipse.persistence.oxm.annotations

public @Interface XmlInverseReference

extends Annotation
Annotations
@Target:FIELD, METHOD
@Retention:RUNTIME
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

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;
    ...
 }

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

mappedByback to summary
public String mappedBy()