title: QueryOver - adding additional criteria to a Join
body: <p>I'm quite new to NHibernate and QueryOver and I can't get NHibernate to generate the SQL I need.</p>
  
  <p>I need to make a join and have an extra criteria on so I avoid getting to much data from the table I'm joining with.</p>
  
  <p>The SQL I receive from QueryOver is:</p>
  
  <pre><code>SELECT * FROM adresse this_ 
  left outer join r580_test.afvigelse remarkalia1_ on this_.id=remarkalia1_.adrid 
  left outer join r580_test.afvigelseklagepunkter remarkcomp5_ on remarkalia1_.id=remarkcomp5_.afvigelseid 
  left outer join r580_test.klagepunkter complainta2_ on remarkcomp5_.klagepunktid=complainta2_.id 
  WHERE  this_.id = 16633 and remarkalia1_.dato between '2009-03-13 00:00:00' and '02-03-2012 16:34:35'
  </code></pre>
  
  <p>What I would like is this(the where date between has been moved to the end for the first left outer join):</p>
  
  <pre><code>SELECT * FROM adresse this_ 
  left outer join r580_test.afvigelse remarkalia1_ on this_.id=remarkalia1_.adrid and remarkalia1_.dato between '2009-03-13 00:00:00' and '02-03-2012 16:34:35'
  left outer join r580_test.afvigelseklagepunkter remarkcomp5_ on remarkalia1_.id=remarkcomp5_.afvigelseid 
  left outer join r580_test.klagepunkter complainta2_ on remarkcomp5_.klagepunktid=complainta2_.id 
  WHERE  this_.id = 16633
  </code></pre>
  
  <p>My QueryOver looks like this:</p>
  
  <pre><code>adr = session.QueryOver&lt;Address&gt;()
      .Where(x =&gt; x.Id == 16633)
      .JoinQueryOver&lt;Remark&gt;(y =&gt; y.Remarks).Where(y =&gt; y.Created &gt; DateTime.Now.AddDays(-14))
      .JoinAlias(y =&gt; y.RemarkComplaint, () =&gt; complaintAlias, JoinType.LeftOuterJoin)
      .SingleOrDefault();
  </code></pre>
  
  <p>Anyone got an idea about how to fix this?</p>