|
I have a class hierarchy that looks something like this:
class A is abstract class B is a concrete class, extends A class C is an abstract class, extends A classes C1, C2, and C3 are concrete classes, extends C.
C1, C2, C3 have some transient data and do not have any additional data to be stored in the database.
I would like to find an annotation that maps my object hierarchy to tables A, B, C. Something like this:
class A has <table name="A"></table> <inheritance strategy="JOINED"/> <discriminator-column name="type" discriminator-type="STRING" />
class B has <table name="B"></table> <primary-key-join-column name="id" referenced-column-name="id"/> <discriminator-value>B</discriminator-value>
class C has <table name="C"></table> <inheritance strategy="SINGLE_TABLE"/> <discriminator-column name="type" discriminator-type="STRING" />
class C1 has <primary-key-join-column name="id" referenced-column-name="id"/> <discriminator-value>C1</discriminator-value>
class C2 has <primary-key-join-column name="id" referenced-column-name="id"/> <discriminator-value>C2</discriminator-value>
Does anyone know if hibernate or JPA supports a hybrid inheritance strategy using both joined and then single_table?
Thanks for any info you have provide!
|