How do you write criteria on if condition using hibernate criteria.
My query that needs to be transformed is
SELECT date, product, IF(type = 'msrp', amount, 0) price,
IF(type != 'msrp', amount, 0) tax FROM productdetail group by date, product;
Please provide the right usage of if statement in hibernate criteria.