Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://www.eclipse.org/eclipselink/moxy.php" rel="nofollow noreferrer">EclipseLink JAXB (MOXy)</a> can handle this with its bidirectional mapping with @XmlInverseReference:</p> <pre><code>import javax.persistence.*; @Entity public class Customer { @Id private long id; @OneToOne(mappedBy="customer", cascade={CascadeType.ALL}) private Address address; } </code></pre> <p>and </p> <pre><code>import javax.persistence.*; import org.eclipse.persistence.oxm.annotations.*; @Entity public class Address implements Serializable { @Id private long id; @OneToOne @JoinColumn(name="ID") @MapsId @XmlInverseReference(mappedBy="address") private Customer customer; } </code></pre> <p><strong>For more information see:</strong></p> <ul> <li><a href="http://bdoughan.blogspot.com/2010/07/jpa-entities-to-xml-bidirectional.html" rel="nofollow noreferrer">http://bdoughan.blogspot.com/2010/07/jpa-entities-to-xml-bidirectional.html</a></li> <li><a href="http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JPA" rel="nofollow noreferrer">http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JPA</a></li> </ul> <p>You can also use MOXy's externalized representation of the metadata for this. For more information see:</p> <ul> <li><a href="https://stackoverflow.com/questions/4385784/xml-to-java-mapping-tool-with-mapping-descriptor/4388705#4388705">XML to Java mapping tool - with mapping descriptor</a></li> <li><a href="http://wiki.eclipse.org/EclipseLink/Examples/MOXy/EclipseLink-OXM.XML" rel="nofollow noreferrer">http://wiki.eclipse.org/EclipseLink/Examples/MOXy/EclipseLink-OXM.XML</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload