title: How to do multiple joins with NHibernate Criteria API
body: <p>I have the following data model:</p>
  
  <pre><code>Page
  - Id      // Pk
  - Type    // int
  
  Section
  - Id      // Pk
  - Page    // Fk
  
  Comment
  - Id      // Pk
  - Section // Fk
  - Date    // DateTime
  </code></pre>
  
  <p>I'm trying to query all comments that are associated with a certain Page (Say page.id = 2 and page.Type = 1) within a time limit. I tried it like this:</p>
  
  <pre><code>   var criteria = session.CreateCriteria&lt;Comment&gt;()
  
     .Add(Restrictions.Eq("Section.Page.Id", pageId))
     .Add(Restrictions.Eq("Section.Page.Type", pageType))
     .Add(Restrictions.Ge("Date", start))
     .Add(Restrictions.Lt("Date", end));
  </code></pre>
  
  <p>However, this fails as I get an error says "could not resolve property: Page of: TestNamespace.Comment". This normally would indicate mapping errors, but it works in all other cases, so I'm inclined to belive the error lies in the query.</p>
  
  <p>To make matters worse, Comment.Section might be null in some cases (there are comments that are not associated with a section nor page). In that case I want to ignore those comments.</p>
  
  <p>Any advice ?</p>
  
  <p>Thanks!</p>