I have a three level inheritance(A, B and C) with 2 children(C1 and C2) extending the second level parent class(B)
given that each entity has specific table for each of them in the data model,
Code:
@Entity
@Table(name="A")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="A_DISCRIMINATOR_COLUMN")
public abstract class A {}
@Entity
@Table(name="B")
@DiscriminatorValue(“B_type”)
@DisriminatorColumn(“B_DISCRIMINATOR_COLUMN”)
@PrimaryKeyJoinColum("b_id")
public abstract class B extends A {}
@Entity
@Tabe(name = “C1”)
@DiscriminatorValue(“C_1_type”)
@PrimaryKeyJoinColum("c_1_id")
public class C1 extends B {}
@Entity
@Tabe(name = “C2”)
@DiscriminatorValue(“C_2_type”)
@PrimaryKeyJoinColum("c_2_id")
public class C2 extends B {}
I cannot map my discriminator values using this kind of inheritance strategy, the discriminator values of the children(C1 and C2) are the values being mapped into the Grand-parent (A)'s Discriminator Column and the Parent (B)'s Discriminator column is having a null value. what could be the solution or any approach I can do to make this kind of strategy possible?