Is it possible to force hibernate to use discriminator column for inheritance type joined? According to JPA2.0 specification this should be possible but i can\'t achieve it
I've used SINGLE_TABLE
with a Discriminator and a SecondaryTable
on the subclass to do this very thing. I.E.
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="TYPE")
@Entity
public class Parent
@Entity
@DiscriminatorValue("C")
@SecondaryTable(name = "child", pkJoinColumns = {@PrimaryKeyJoinColumn(name="id", referencedColumnName = "id")})
public class Child extends Parent
When you add a new sub class you add a new table with the relevant extended data fields in it.
Do you want to use @Inheritance(strategy=InheritanceType.SINGLE_TABLE)?