Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I agree that using the same model classes is the right approach. If you are concerned about annotation clutter, you could use a JAXB implementation (such as <a href="http://www.eclipse.org/eclipselink/moxy.php" rel="nofollow noreferrer">EclipseLink JAXB</a>) that provides a mechanism for externalizing the metadata:</p> <ul> <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> <p>Also since you are using a JPA model EclipseLink JAXB (MOXy) has extensions for making this easier:</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>Here is an example of using one model with JAXB &amp; JPA to create a RESTful service:</p> <ul> <li><a href="http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-15.html" rel="nofollow noreferrer">Part 1 - The database</a></li> <li><a href="http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-25.html" rel="nofollow noreferrer">Part 2 - JPA entities</a></li> <li><a href="http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-35.html" rel="nofollow noreferrer">Part 3 - Mapping entities to XML using JAXB</a></li> <li><a href="http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-45.html" rel="nofollow noreferrer">Part 4 - The RESTful service</a></li> <li><a href="http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-55.html" rel="nofollow noreferrer">Part 5 - The client</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