Hibernate is able to define a many-to-many relationship through a 3rd table, only if that 3rd table contains just the PKs of both tables.
In a case like yours, on the contrary, where there is more information on the "relationship table", I would advise trying to think that "many-to-many" relationship into two different relationship.
1) A "one to many" relationship between A and AB
2) A "many to one" relationship between AB and B
I would further advice, in order to make things simpler for Hibernate, to create an additional, single-field PK for the AB table.
_________________ Gonzalo Díaz
|