40414243444546
"where (cat.mate, cat.birthdate) in " + "(select cat.mate, max(cat.birthdate) from Cat cat group by cat.mate))", subQuery); } private HibernateSubQuery subQuery() { return new HibernateSubQuery(); }
1152115311541155115611571158115911601161
@Test public void SubQuery2() { QCat cat = QCat.cat; QCat other = new QCat("other"); List<Cat> cats = query().from(cat) .where(cat.name.in(new HibernateSubQuery().from(other) .groupBy(other.name).list(other.name))) .list(cat); assertNotNull(cats); }