Is there any way to do the following in HQL:
SELECT case when flag = true then SUM(col1) else SUM(col2) FROM myTable
Apparently the ability to do this was added in 3.0.4, with the limitation that you cannot use sub-selects in the else clause.