Hello, I'm kind of a begginer with hibernate and I have a "problem" when I persist an object.
I have the following mapping:
Code:
<hibernate-mapping package="com.du.security.domain">
<class name="Role" table="ROLE">
...
<set name="permissions" table="ROLE_PERMISSIONS" cascade="save-update">
<key column="ROLE_ID"/>
<many-to-many
class="Feature"
column="FEATURE_ID"/>
</set>
</class>
</hibernate-mapping>
I'm tring to add a new Role just by having at my disposal some Feature ids.
What would be the best way to do this?
Loading each Feature instance (to get a proxy?) using the feature id that I have and adding them to the new Role instance permission collections?