If you do NOT want to cascade on remove then don't set it. The cascade options
refer to the Java objects NOT the representation in the database.
The rows from the ManyToMay JoinTable will get removed WITHOUT any cascading
options set because removing the User and not the rows in the join table
anonymous wrote : When I tried to remove User, it will remove all the roles in
the ROLE that the user has and also all the related records in the
USER_ROLE_LINK.
|
I would say this is the expected behavoiour. You asked to remove the user and
all of his roles.
anonymous wrote :
| And how
Hi,
I tried to use CascadeType.REMOVE, but it got the same result.
I just want to remove the USER and its relationship when removing a user.
Please help, I tried many ways but also failed.
Best regards,
Eric
View the original post :