title: In NHibernate, how to delete all elements of an associated set?
body: <p>Let's say I have a class named Parent, in my hbm.xml there is a one-to-many set of the Child class. I want to delete all children of a given parent as efficiently as possible. This is what I'm doing now:</p>
  
  <pre><code>foreach (var child in parent1.Children)
      session.Delete(child);
  parent1.Children.Clear();
  </code></pre>
  
  <p>This results in 3+ different SQL statements: a SELECT that fetches the children entities, followed by an UPDATE that sets the foreign key in all children to NULL based on the parent foreign key, followed by multiple DELETE statements, one by one.</p>
  
  <p>What I would like to see is one DELETE that deletes all children, based on their parent foreign key. Is there an NHibernate way to do that? Or do I need to bite the bullet and issue a raw SQL statement?</p>