I am trying to map the standard User-Role relationship. The roles are keep in a table with a roleId. This is a static list of roles. The user can have many roles. I have a join table that tracks the user to his roles. I am using the following mapping on the User object to populate the roles:
Code:
<set name="roles" table="tb_subtype_info" lazy="false" cascade="all">
<key column="sub_id"/>
<many-to-many
column="cnbc_subscriber_type_id"
unique="true"
class="com.ge.nbc.cnbc.svc.businessobjects.SubscriberType"/>
</set>
This mapping works fine when I query a user. The problem I am having is when I update or create a user an extra update is performed against the Role table even though this table did not change.
Is there any way to eliminate this relationship?
Thanks,
Pete