When using Projections.sqlGroupProjection() it is only possible to use the properties of the root entity in the sql. This seems overly limiting. Why not make it available to leverage any of the other table aliases that may exist with a similar syntax used for {alias}?
For example:
Projections.sqlGroupProjection( "avg({alias}.price) * {user}.state.taxRate as totalPrice" "{item}.id having totalPrice between 100 and 200" new String[] {"totalPrice"} new Type[] {Hibernate.BIG_DECIMAL});
Projections.sqlGroupProjection( "avg({alias}.price) * {user}.state.taxRate as totalPrice" "{item}.id having totalPrice between :low and :high" new String[] {"totalPrice"} new Type[] {Hibernate.BIG_DECIMAL}) .setParameter("low", myLowValue) .setParameter("high", myHighValue);