title: Hibernate deletes collection elements on transaction commit
body: <p>I can't find out why hibernate tries to delete collection elements after transaction commit. And I even didn't ask it to do so.</p>
  
  <p>Any ideas?</p>
  
  <p>Technical details are posted below.</p>
  
  <p>Hibernate dialect:</p>
  
  <pre><code>    org.hibernate.dialect.SQLServerDialect
  </code></pre>
  
  <p>Entity class:</p>
  
  <pre><code>    @Entity
      @Table(name = "View_m_activity", schema = "model")
      public class SourceActivity {
          private Set&lt;SourceActivityAttrOut&gt; outputAttributes;
  
          private Long ID;
  
          @Id
          public Long getID() {
              return ID;
          }
  
          public void setID(Long ID) {
              this.ID = ID;
          }
  
          @ElementCollection(fetch = FetchType.EAGER)
          @CollectionTable(name = "View_m_activity_attr_out", schema = "model", joinColumns = @JoinColumn(name = "activity_id"))
          public Set&lt;SourceActivityAttrOut&gt; getOutputAttributes() {
              return outputAttributes;
          }
  
          public void setOutputAttributes(Set&lt;SourceActivityAttrOut&gt; outputAttributes) {
              this.outputAttributes = outputAttributes;
          }
      }
  </code></pre>
  
  <p>Collection element entity class:</p>
  
  <pre><code>    @Embeddable
      public class SourceActivityAttrOut {
          private String code;
  
          public String getCode() {
              return code;
          }
  
          public void setCode(String code) {
              this.code = code;
          }
      }
  </code></pre>
  
  <p>Execution code:</p>
  
  <pre><code>    @Transactional
      public void readSource(SourcePool sourcePool) {
          sessionFactory.getCurrentSession().createQuery("from SourceActivity", SourceActivity.class).list();
      }
  </code></pre>
  
  <p>Log info:</p>
  
  <pre><code>Hibernate: 
      select
          sourceacti0_.ID as ID1_0_ 
      from
          model.View_m_activity sourceacti0_
  
  Hibernate: 
      select
          outputattr0_.activity_id as activity1_1_0_,
          outputattr0_.code as code2_1_0_ 
      from
          model.View_m_activity_attr_out outputattr0_ 
      where
          outputattr0_.activity_id=?
  
  Hibernate: 
      select
          outputattr0_.activity_id as activity1_1_0_,
          outputattr0_.code as code2_1_0_ 
      from
          model.View_m_activity_attr_out outputattr0_ 
      where
          outputattr0_.activity_id=?
  
  Hibernate: 
      select
          outputattr0_.activity_id as activity1_1_0_,
          outputattr0_.code as code2_1_0_ 
      from
          model.View_m_activity_attr_out outputattr0_ 
      where
          outputattr0_.activity_id=?
  
  Hibernate: 
      select
          outputattr0_.activity_id as activity1_1_0_,
          outputattr0_.code as code2_1_0_ 
      from
          model.View_m_activity_attr_out outputattr0_ 
      where
          outputattr0_.activity_id=?
  
  Hibernate: 
      delete 
      from
          model.View_m_activity_attr_out 
      where
          activity_id=?
  </code></pre>