title: Hibernate many-to-many self-reference, how to delete without cascade?
body: <p>I have a many-to-many relation on a single object with itself:</p>
  
  <pre><code>    &lt;set name="relatedPersons" lazy="false"  table="PersonRelatedPerson" 
             cascade="none" &gt;
      &lt;key column="personId" foreign-key="fk_related_person" not-
          null="false"/&gt;
         &lt;many-to-many column="relatedPersonId" class="Person" not-found="ignore"/&gt;
      &lt;/set&gt;
  </code></pre>
  
  <p>as you can see I have set cascade to "none" because, when i delete one person, ofcourse i just would like to delete the relations from the table PersonRelatedPerson, and not the related Persons them selves. When i try to do delete with this mapping, i get the 
  ConstraintViolationException:  Could not execute JDBC batch update....</p>
  
  <p>I am guessing that it is somehow possible to delete this by hibernate by properly setting some mapping flags (or do i have to do some weird workarounds eg. first delete second person from set of first person, delete first person from set of second, and then delete first.... i really dont wanna do this :D)</p>
  
  <p>Appreciate all the help!!!</p>