title: Complex query in nHibernate using DetachedCriteria
body: <p>I'm currently trying to move from hand-crafted hql to queries constructed via DetachedCriteria. I have and HQL:</p>
  
  <pre><code>from GenericObject genericObject 
        left join fetch genericObject.Positions positions
        where (positions.Key.TrackedSourceID, positions.Key.PositionTimestamp) in 
        (select gp.Key.TrackedSourceID, max(gp.Key.PositionTimestamp)
         from GenericPosition gp 
  group by gp.Key.TrackedSourceID) 
  </code></pre>
  
  <p>Now using DetachedCriteria:</p>
  
  <pre><code>var subquery = DetachedCriteria
                  .For (typeof (GenericPosition), "gp")
                  .SetProjection (Projections.ProjectionList ()
                                      .Add (Projections.Property ("gp.Key.TrackedSourceID"))
                                      .Add (Projections.Max ("gp.Key.PositionTimestamp"))
                                      .Add (Projections.GroupProperty ("gp.Key.TrackedSourceID"))
                  );
              var criteriaQuery = DetachedCriteria
                  .For (typeof (GenericObject), "genericObject")
                  .CreateAlias ("genericObject.Positions", "positions")
                  .SetFetchMode ("genericObject.Positions", FetchMode.Eager)
                  .Add (Subqueries.In (??, subquery))
  </code></pre>
  
  <p>I don't know what to type instead of ?? to create expression like (positions.Key.TrackedSourceID, positions.Key.PositionTimestamp)</p>