Pls help me to create the mapping classes in annotations for the following scenario.
I have four tables A,B,C,D
TABLE A{
id,
foreign_ key_id
foreign_ key_id_Type
}
'foreign_key_id' in table A is a primary key of table B/C/D.
From 'foreign_ key_id_Type' in TABLE A, we can say to which table(among B,C and D) foreign_key_id of table A is referring .
i.e
if foreign_ key_id_Type="B", then foreign_ key_id refers a record in TABLE B
if foreign_ key_id_Type="C", then foreign_ key_id refers a record in TABLE C
if foreign_ key_id_Type="D", then foreign_ key_id refers a record in TABLE D
|