title: Composite discriminator jpa
body: <p>I'm getting extra DTYPE in my query while my jps entities are structured as follow:</p>
  
  <pre><code>@Entity
  @Inheritance(strategy=InheritanceType.JOINED)
  @DiscriminatorColumn(name="PRODUCT_TYPE")
  public abstract class Product extends Tent implements Serializable {
      @@ManyToOne(fetch = FetchType.LAZY)
      @JoinColumn(name = "PRODUCT_TYPE")
      private TransType transType;
      ...
  }
  
  @Entity
  @Table(name="CAR")
  @DiscriminatorColumn(name="CAR_TYPE") 
  public class Car extends Product {
  
      @Column(name = "car_ent_id", insertable = false, updatable = false)
      private int carEntId;
      ....
  }
  </code></pre>
  
  <p>Tent<br>
  |<br>
  Product<br>
  |<br>
  <strong>LEVEL-1</strong> -->[Car_1_1] [car_1_2]....<br>
  |<br>
  <strong>LEVEL-2</strong> -->[car_2_1] [car_2_2]...</p>
  
  <p>So what I'm trying to achieve, discriminate all the entities at both LEVEL-1 and 2 together. Abstract class Product is having type which discriminating immediately 1 level down but when we are further extending level 1 entities at level 2. This's where I'm not having any clue.</p>
  
  <p>Can we have custom non-db field defined in Product and assigning a value to each level-1 entity and for level-2 entities TYPE can work somehow?</p>
  
  <p>Not really having any clue</p>
  
  <p>Thanks</p>