Hi,
I have the following scenario:
Entity Class B & C extends A
Entity Class E & F estends D
Embedable Class EPK & FPK extends GPK (these are composite primary keys)
Class E uses EPK & class F uses FPK.
Class A has 1..2 association with D (meaning either 2E's or 2F's or E & F)
Code:
1..2
A<>-------------------- D GPk
/\ /\ /\
B C E F EPK FPK
As such I have added 2 @OneToOne association in class A instead of @OneToMany due to other reasons.
The issue is Class B or Class C could have 2 E's or 2F's or E & F, which means that the join column for Entity B & C is not sure? Can anyone please help is solving this issue?
Thanks in advance
Kuga
Can you provide more details on EPK and FKP? Do they have different set of fields? If so, relations B->E and C->F use different foreing key.
I doubt this kind of inheritance can be acheived in a relatinal DB.
Try to remodel, and if posiible get rid of compisite keys.