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.
And how can I remove all the users that a role have when remove a ROLE ?
Have you tried removing the CasadeType.ALL and replace it with the cascade types you actually want?
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.
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 would violate a fk constraint.