title: JPA Entity inheritance
body: <p>Presume I have this class:</p>
  
  <pre><code>@Entity
  public class VehicleReport {
      @Id
      @GeneratedValue
      private Long id;
  
      @Column
      @Enumerated(ORDINAL)
      private VehicleType vehicleType;
  
      @OneToMany?
      private Collection&lt;Vehicle&gt; vehicles;
  }
  </code></pre>
  
  <p>And I would like each vehicle type to have it's own subtable, with needed information about each vehicle type.
  For instance:</p>
  
  <p>Abstract class is <code>Vehicle</code>:</p>
  
  <pre><code>@Entity
  public abstract class Vehicle {
      @ManyToOne
      public VehicleReport report;
  
  }
  </code></pre>
  
  <p>And concrete class for each vehicle type</p>
  
  <pre><code>@Entity
  public class Car extends Vehicle {
      //Specific "Car" columns
  }
  </code></pre>
  
  <p>How do i make the join in the parent class <code>VehicleReport</code> to fetch the correct children dependent on <code>VehicleType</code> in <code>VehicleReport</code>?</p>
  
  <p>I've read about <code>@DiscriminatorColumn</code>, but that would mean I would save <code>VehicleType</code> in all of my child tables as well? Even though they have an FK pointing to the parent <code>VehicleReport</code>?</p>
  
  <p>All help appriciaated</p>