I have top level entities TRACK, MEDIA_GROUP and MEDIA, each with an integer primary key. I also have a join table from TRACK to MEDIA_GROUP which is 1:1 and MEDIA has a FK column into MEDIA_GROUP. I'm trying to find a way in hibernate to map a collection of Media directly into the Track object, bypassing the creation of a MediaGroup object.
Basically I want to turn this:
TRACK <-> MEDIA_TRACK_MAP <-> MEDIA_GROUP <-> MEDIA
into this:
TRACK <-> MEDIA_TRACK_MAP <-> MEDIA
But the join column between MEDIA_TRACK_MAP and MEDIA isn't the primary key of MEDIA.