Hi,
I'm trying to create a Map of a many-to-many relationship where the key (index) is in the "target" table.
I have the following schema:
Code:
employee
id
...
employee_rights
employee_id
access_right_id
access_right
id
code
description
I want to have a Map in my Employee object of all access rights keyed by code (a string).
By using the following (or something like the following, I've deleted the original):
Code:
<map name="accessRights" table="employee_rights">
<key column="employee_id"/>
<index column="code"/>
<many-to-many column="access_right_id" class="AccessRight"/>
</map>
I've managed to get a Map working by having the code in the employee_rights table but, apart from the endless duplication, I want to expand my knowledge and find out how to do it!
Can anybody help, please?
Many TIA!
Also, many thanks to all the committers for a really first rate framework. Thanks!
Cheers,
-Carl