Is there a way to use an ICriteria result as a 'base' for a subsequent criteria query?
For example if I would like to create a query
SELECT department_id, sum(cost) AS total
FROM payment
GROUP BY payment.department_id
storing the result as query0
, and then execute the query
SELECT department.name, total
FROM department, query0
JOIN LEFT ON department.id=query0.id
WHERE total > 3
I do not want to have one single huge query executed all at once (which would be the result of creating an ICriteria with subqueries). Note that I have a selection/ restriction on a result of the first query and at the same time including one of its columns in the second query's projection.
The criteria is generated dynamically using strings to identify the classes.