derived from this question, is it possible to use HQL or Criteria for the following SQL statement:
SELECT e.type, count(e), count(d), count (
Well, it seems, case statements are supported:
http://docs.jboss.org/hibernate/core/3.5/reference/en/html/queryhql.html
They just don't seem to work within count(). An alternative would be using sum(case when... then 1 else 0 end) instead