Joined: Wed Sep 26, 2007 6:44 pm Posts: 1
|
Hi,
I have 3 tables
User---->UserRoles<-----Roles
in USER table mapping i have the following many to many mapping :
<set name="Roles" table="UserRoles" cascade="all">
<key column="user_id"/>
<many-to-many column="ROLE_ID" class="a.b.c.Roles"/>
</set>
when i try to delete the user by
session.delete(user);
it gives me oracle constraint violation error. how to map so that hibernate will automatically delete the child records from UserRoles table for that user ( i don't want to delete the corresponding record from Roles)
Thanks
|
|