ManyToMany with cascade all only cascading one way
问题 I have 2 entities: 1) User 2) Department. each contains a SET of the other since the relationship between them is manyToMany, I marked (CascadeType.ALL) on the user entity and the department entity and when i do : userX.getDepartments.remove(departmentX); save(userX); it works like intended - it actually implies that departmentX.getUsers.contains(userX) == false. is called implicitly. BUT , when i do departmentY.getUsers.remove(userX); save(departmentY); it doesn't cascade! meaning - i can do