Is there any way to do the following in HQL:
SELECT case when flag = true then SUM(col1) else SUM(col2) FROM myTable
This is an example using a string comparison in the condition:
SELECT CASE f.type WHEN 'REMOVE' THEN f.previousLocation ELSE f.currentLocation END FROM FileOperation f