I have a domain model that looks like this:
Instruction
| \
Money Other
/ \
Unit Cash
and I want to map this model to my DB using JPA.
All classes map to the same table in the DB, (T_INSTRUCTION).
So I started out with jpa's SINGLE_TABLE inhertance strategy. Separating the Money
and Other
classes using the orm xml discriminate-column="MONEY_TYPE_ID"
.
My problem is I also want to sperate the sub classes Cash
and Unit
but they discriminate on a different column "CASH_TYPE_ID
".
Scanning the docs this doesn't seem possible to me, but I was wondering does anyone out there have any tricks or workarounds to implement this?
Cheers