I can't map the following table structure in hibernate3 xml.
The contacts table links to the countries table using the CID, not the primary key of the countries table, because the application must be language indepedent. The CID is not unique, so many-to-one doesn't work here.
I know there are better ways of doing this (using an extra table for the translation for example), but I'm stuck with this table structure and have to convert it to a hibernate mapping xml.
Can anybody give me advise please?
Thanks!
Code:
[countries table]
ID CID LANGUAGE COUNTRY
123 5 NL Belgiƫ
124 5 EN Belgium
125 5 FR Belgique
126 8 NL Duitsland
127 8 EN Germany
128 8 FR l'Allemagne
[contacts table]
ID NAME COUNTRY
1 contact1 5
2 contact2 8
3 contact3 8
4 contact4 8
5 contact5 5