title: JPA entities: How to establish relationship between Parent and multiple Child classes
body: <p>I have the following Java classes:</p>
  
  <pre><code>public Class Parent {
  
      int someValue1;
  
      ChildType child;
  }
  
  
  public Class ChildType {
  
       int someValue2;
  }
  
  
  public Class ChildA extends ChildType {
  
       int id;
  
       String string;
  }
  
  
  
  public Class ChildB extends ChildType {
  
      int id;
  
      Integer integer;
  }
  </code></pre>
  
  <p>I need to represent Parent, ChildA and ChildB as entity beans with each having a related table in the database.</p>
  
  <p>When I load a Parent I also need to load either ChildA or ChildB depending on the relationship.</p>