title: Sharing objects with jersey json REST client
body: <p>I have written a REST service using jersey which maps a object-structure to a json-result, like:</p>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_JSON)
  @Path("/orders/{id}")
  public Order getById(@PathParam("id") String orderId) {
       return orderService.getById(id); // Simplified
  }
  </code></pre>
  
  <p>It works perfectly and returns the <code>Order</code> object structure as a JSON structure.</p>
  
  <p>Now a (jersey) client accesses this REST service and gets those JSON structure back. It can parse it as a JSON structure, but it would be nice to map it back to (the server's) object structure.</p>
  
  <p>But the server's objects contain many JPA-Annotations and other <code>import</code>s the client does not know about.</p>
  
  <p>How can I share anyway my server object structure as (unannotated?) POJOs to my client? TIA!</p>