I want to map an object collection using the object's id, which is a foreign key, as the map key.
When I try to do this using the following mapping, I get a "Repeated column in mapping for collection" error.
<map name="contestantsInternal" table="roster_contestants">
<key column="roster_id"/>
<index column="contestant_id" type="long"/>
<many-to-many column="contestant_id" class="Contestant"/>
</map>
Mapping this collection as a set without the index works fine but I want to look up the contestants by their id's so I don't have to search the whole set.
Thanks for any assistance.
|