title: Removing child-parent association in GORM
body: <p>Consider the following domain classes</p>
  
  <pre><code>class Business{
      static hasMany = [contacts:ContactPerson]
  }
  
  class ContactPerson{
  }
  </code></pre>
  
  <p>Given the following domain classes, say we use the following examples:</p>
  
  <blockquote>
    <p>Alice is ACME's contact person. Bob and Carol are Calamity Corp's contact person.</p>
  </blockquote>
  
  <p>Say I wanted to remove Bob in the ContactPerson table.  Thus:</p>
  
  <pre><code>bob.delete(flush:true)
  </code></pre>
  
  <p>But the code will result to the server complaining about contraints:</p>
  
  <pre><code>ERROR: update or delete on table "contact_person" violates foreign key constraint
      "fk4a69c6b329ef2fe1" on table "business_contact_person"
  Detail: Key (id)=(174) is still referenced from table "business_contact_person".
  </code></pre>
  
  <p>In this context, the exception is thrown because Bob is still associated with Calamity Corp.  </p>
  
  <p><strong>How do I delete Bob from the ContactPerson table?</strong> I wanted to remove Bob from the database altogether.  I don't want to add belongsTo since I don't want to cascade the delete to Business' children (that is to say, if I delete Acme Corp from the database, I still want Alice to be in the system). </p>
  
  <p>I've seen examples on <a href="http://blog.springsource.com/2010/07/02/gorm-gotchas-part-2/" rel="nofollow">disassociating the parent from the child</a>  but not the other way around.</p>