title: Filtering NHibernate Hierarchy using link tables
body: <p>Let's say I have a simple parent->child class structure as shown below</p>
  
  <pre><code>Public Class Parent
    Public ParentID As Integer
    Public Children As IList(Of Child)
  End Class
  
  Public Class Child
    Public ChildID As Integer
    Public Parent As Parent
  End Class
  </code></pre>
  
  <p>These are mapped to two tables using Fluent NHibernate. No problem.</p>
  
  <p>I now have a 3rd class, let's call 'User'. This class contains a list of Parent objects.</p>
  
  <pre><code>Public Class User
    Public UserID As Integer
    Public Parents As IList(Of Parent)
  End Class
  </code></pre>
  
  <p>However, the list of parents should be filtered to the user by a mapping table (UserParentMap) which contains UserID and ParentID. Furthermore, the 'Child' objects should be filtered in a similar way by a table called UserChildMap which contains UserID and ChildID.</p>
  
  <p>My question is - is it possible to get NHibernate to automatically use these mapping tables to filter the parent/child collection when mapping them to the user?</p>
  
  <p>Thanks</p>
  
  <p>James</p>