title: Hibernate removes relation on update
body: <p>I want to define my @ManyToMany relationship with JPA Annotations so that relations are not removed when updating entity.</p>
  
  <pre><code>@ManyToMany(targetEntity=Event.class, cascade={CascadeType.ALL}, fetch = FetchType.LAZY)
  @JoinTable(
    name = "event_user", 
    joinColumns = @JoinColumn(name = "user_id"), 
    inverseJoinColumns = @JoinColumn(name = "event_id")
  )
  private Set&lt;Event&gt; events;
  </code></pre>
  
  <p>and Event class</p>
  
  <pre><code>@ManyToMany(cascade = {CascadeType.ALL}, mappedBy="events", targetEntity=User.class, fetch = FetchType.LAZY)
  private Set&lt;User&gt; attending;
  </code></pre>
  
  <p>I thought setting CascadeType.REMOVE would not trigger deletion when updating but when I call update on a user object, all its related events are removed.</p>
  
  <p>This is from my DAO</p>
  
  <pre><code>@Override
  public User update(User entity) {
      sessionFactory.getCurrentSession().update(entity);
      return entity;
  }
  </code></pre>
  
  <p>When I call update on my entity, Hibernate does:</p>
  
  <pre><code>Hibernate: delete from event_user where user_id=?
  </code></pre>