I know this issues has already been discussed. But i still have a question about this. I have two tables A & B and a thrid table C which is a join table holding the association between A and B. I did mapping for this scenario and it works fine. Now, i need to add few more columns to the join table. The example in Christian Bauer book suggests to create an additional class for the join table and use a component mapping. It also says the new columns that are being added to the join table should be part of the composite primary key. I am not clear about this condition. What if i don't want to make the new column(s) as part of PK?. Currently, the composite PK of my join table is the FK id columns of table A and B.
|