title: deleted object would be re-saved by cascade (remove deleted object from associations) while updating the user
body: <p>Hibernate Mappings: <BR><BR>
  User.hbm.xml<BR></p>
  
  <pre><code>&lt;hibernate-mapping package="com.user"&gt;
    &lt;class name="User" lazy="true" table="USER"&gt;
  &lt;set name="StudentOrganizations" inverse="true" cascade="all-delete-orphan"    fetch="select" sort="natural"&gt;
  &lt;key&gt;
  &lt;column name="STUDENT_ID" not-null="true" /&gt;
      &lt;/key&gt;
  &lt;one-to-many class="com.StudentOrganization" /&gt;
  &lt;/set&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p><BR><BR>
  StudentOrganization.hbm.xml<br></p>
  
  <pre><code>&lt;hibernate-mapping&gt;
   &lt;class name="com.StudentOrganization" table="USER_ORGANIZATION"&gt;
   &lt;cache usage="read-write" /&gt;
     &lt;many-to-one name="user" class="com.User" update="false" insert="false" fetch="select"&gt;
  &lt;column name="STUDENT_ID" not-null="true" /&gt;
     &lt;/many-to-one&gt;
     &lt;many-to-one name="organization" class="com.Organization" update="false" insert="false" fetch="select"&gt;
    &lt;column name="ORGANIZATION_ID" not-null="true" /&gt;
     &lt;/many-to-one&gt;
   &lt;/class&gt;
   &lt;/hibernate-mapping&gt;&lt;BR&gt;
  </code></pre>
  
  <p>Pseudocode while updating Student Record.<BR></p>
  
  <pre><code>myDAO.detach(myOldDetails);
  myDAO.merge(aResource);
  </code></pre>
  
  <p>while updating the student details I get error as 
  <code>"deleted object would be re-saved by cascade (remove deleted object from associations): [com.StudentOrganization]....."</code></p>