title: How do you send back a subset of a JPA entity that is owned by another entity?
body: <p>I have an entity that owns another entity:</p>
  
  <pre><code>//psuedocode    
  public class ClassA{
     private String name;
  
     @OneToOne
     private ClassB classb;
  }
  
  public class ClassB{
     private String thing1;
     private String thing2;
     private String thing3;
  }
  </code></pre>
  
  <p>When I retrieve ClassA objects, I don't want to see ClassB.thing3, but I do want to see thing1 and thing 2:</p>
  
  <pre><code>{
  "name":"classa",
  "classb":{
           "thing1":"hi",
           "thing2":"there"
          }
  }
  </code></pre>
  
  <p>But if I query for ClassB I want to see everything:</p>
  
  <pre><code>{"thing1":"hi",
   "thing2":"there",
   "thing3":"joseph"}
  </code></pre>
  
  <p>So I can't just put an ignore annotation over thing3, because then I'll ignore it on the second fetch. I tried a <code>Converter&lt;ClassB&gt;</code>, but that forces me to implement <code>toString()</code> and <code>fromString()</code> for the JSON, which dies on converting the JSON object to Java-side (the converter expects a String, but gets the object instead).</p>
  
  <p>I want to avoid building/parsing the JSON object myself if possible to let my json provider do the work, if possible. I'm on Johnzon.</p>