title: NHibernate criteria query using Max() projection
body: <p>I have to implement something like this using NHibernate</p>
  
  <pre><code>DetachedCriteria maxDateQuery = DetachedCriteria.forClass(FtpStatus.class);
  ProjectionList proj = Projections.projectionList();
  proj.add(Projections.max("datetime"));
  proj.add(Projections.groupProperty("connectionid"));
  maxDateQuery.setProjection(proj);
  
  Criteria crit = s.createCriteria(FtpStatus.class);
  crit.add(Subqueries.propertiesEq(new String[] {"datetime", "connectionid"}, maxDateQuery));
  
  List&lt;FtpStatus&gt; dtlList = crit.list();
  </code></pre>
  
  <p>(This snippet is from <a href="https://stackoverflow.com/questions/2723803/hibernate-criteria-query-using-max-projection-on-key-field-and-group-by-foreig">Hibernate criteria query using Max() projection on key field and group by foreign primary key</a>)</p>
  
  <p>My problem is that Nhibernate doesn't implement "Subqueries.propertiesEq" which is used in this row:</p>
  
  <pre><code>crit.add(Subqueries.propertiesEq(new String[] {"datetime", "connectionid"}, maxDateQuery));
  </code></pre>
  
  <p>Could you please suggest a workaround? </p>