Hello,
When I have a mapping like (class Forfait):
Quote:
<set
role="services"
table="tbl_liens_forfaits_services"
>
<key column="forfait_id"/>
<many-to-many
class="Service"
column="service_id"
/>
</set>
then it's easy to add / remove elements in the set:
forfait.getServices().add(service)
forfait.getServices().remove(service)Now if I have to put some information on the association,
then I use composite-element :
Quote:
<set
role="services"
table="tbl_liens_forfaits_services"
>
<key column="forfait_id"/>
<composite-element class="RelationForfaitService">
<property name="precision" type="string"/>
<many-to-one name="service" column="service_id" class="Service"/>
</composite-element>
</set>
Then what is the smartest way to code when I have to add & remove
elements from the Set?
Thanks
--
Franck