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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…