Hi,
as you did not report how you mapped class Car,
it is not completely clear to me whether you use/want bidirectional or unidirectional relationship.
Quote:
both collections are trying to add a duplicate AFICIONADO_ID column to the CAR table
This suggests me that you want to have the relationship bidirectional.
Well in this case, that what you intend to do currently is not mappable as it goes against Uml-specification,
you are currently trying to do something like this
+----------------+ +---------------------+
| AFICIO |---\ | CAR |
| | >------------- | af_id |
| |---/ | |
+----------------+ +---------------------+
But you cannot start from Aficio with 2 relations and arrive to Car just with one.
You cannot 'share' the same field CAR.AFICIONADO_ID for 2 different relations!
Solution:
Alternative1: model the 2 relations unidirectional from Aficio to Car (specifying 2 different secondary table names !)
+----------------+ +---------------------+
| AFICIO |------------------->| |
| | | CAR |
| |-------------------->| |
+----------------+ +---------------------+
Alternative2: use different key column names in order that Car has 2 different foreign keys,
in this case you can remove the where-clause
+----------------+ +---------------------+
| AFICIO |---------------------| af_id_rent |
| | | CAR |
| |--------------------- | af_id_own |
+----------------+ +---------------------+