title: NHibernate Many-To-One on Joined Subclass with Filter
body: <p>I have a class setup that looks something like this:</p>
  
  <pre><code>public abstract class Parent
  {
      public virtual bool IsDeleted { get; set; }
  }
  
  public class Child : Parent
  {
  }
  
  public class Other
  {
      public virtual ICollection&lt;Child&gt; Children { get; set; }
  }
  </code></pre>
  
  <p>Child is mapped as a joined-subclass of Parent.
  Childen is mapped as a Many-To-One bag. The bag has a filter applied to it named SoftDeletableFilter.  The filter mapping looks like: </p>
  
  <pre><code>&lt;filter-def name="SoftDeleteableFilter" condition="(IsDeleted = 0 or IsDeleted is null)" /&gt;
  </code></pre>
  
  <p>That problem is that when Other.Children is loaded the filter is being applied to the Child table and not the parent table. Is there any way to tell NHibernate to apply the filter to the parent class?</p>
  
  <p>Edit:
  Here's the parent mapping:</p>
  
  <pre><code>&lt;class name="Parent"&gt;
    &lt;id ..
    &lt;property name="IsDeleted" type="System.Boolean"&gt;
      &lt;column name="IsDeleted" /&gt;
    &lt;/property&gt;
    &lt;joined-subclass name="Child"&gt;
      &lt;key&gt;
        &lt;column name="ParentId" /&gt;
      &lt;/key&gt;
      ...
    &lt;/joined-subclass&gt;
  &lt;/class&gt;
  </code></pre>