Thanks Symon, I did know this, but I can't manage to pull out something useful.
I've tried this:
Code:
DetachedCriteria d1 = DetachedCriteria.For (typeof (Payment));
DetachedCriteria d2 = DetachedCriteria.For (typeof (Bill));
d1.SetProjection (Projections.ProjectionList ()
.Add (Projections.Sum ("Amount"))
.Add (Projections.GroupProperty ("Bill")));
/* Note that "Payments" is a IList attribute in Bill */
d2.CreateCriteria ("Payments").Add (Subqueries.Exists (d1));
MyMainCriteria.Add (Subqueries.PropertyEq ("Amount", d2));
That results in a "Object reference not set to an instance of an object."
:-(