I have 5 table TA1, TA2, TB1, TB2 and TS. Table TA1 having many to many relationship with table TB1 and table TA2 having many to many relationship with table TB2. the 2 many to many relationship between the 4 tables are joined using one common table TS. Schema of the 5 tables are as below:
TA1: ta1ID, etc... TA2: ta2ID, etc... TB1: tb1ID, etc... TB2: tb2ID, etc...
TS: taId, tbId, tableType //tableType is a string. possible value is either table1 or table2.
Can you show how to represent this relationship in Hibernate? 2 relationships joined using one common table which has a field that help to indicate whether a row belong to the first or second relationship.
Thanks,
|