title: Correct way to remove object from @ManyToMany list
body: <p>I created relation @ManyToMany with the same entity.</p>
  
  <p>Here is my entity:</p>
  
  <pre><code>@Entity
  @Table(name = "user")
  public class User extends BaseEntity implements Serializable {
  
  ...
  
  @ManyToMany(cascade = CascadeType.ALL)
  @JoinTable(name = "table_friends", joinColumns =
  @JoinColumn(name = "userId"), inverseJoinColumns =
  @JoinColumn(name = "friendId"))
  private List&lt;User&gt; friends;
  
  @ManyToMany(cascade = CascadeType.ALL)
  @JoinTable(name = "table_friends", joinColumns =
  @JoinColumn(name = "friendId"), inverseJoinColumns =
  @JoinColumn(name = "userId"))
  private List&lt;User&gt; friendsof;
  </code></pre>
  
  <p>I created a few "users" and added them to friend list:</p>
  
  <pre><code>User u1 = new User();
  User u2 = new User();
  User u3 = new User();
  
  u1.getFriends().add(u2);
  u1.getFriendsof().add(u2);
  u1.getFriends().add(u3);
  u1.getFriendsof().add(u3);
  </code></pre>
  
  <p>When I remove a friend from the list <code>u1.getFriends().remove(u3)</code>, everything is ok . But when I want to delete the user from the database <code>u3.remove()</code>, friends of u1 still are the same, although already in the database list of friend is correct. </p>
  
  <ol>
  <li>Can I somehow refresh the list after removing a user?</li>
  <li>And if so, how can I know which list of friend I need to refresh?</li>
  </ol>
  
  <p>Edit: Also seems to me that I should remove the (cascade = CascadeType.ALL), because when I remove u1, removes all paired members. Is this the correct behavior?</p>