title: Please provide example for an If statement in hibernate criteria
body: <p>How do you write criteria on if condition using hibernate criteria.</p>
  
  <p>My query that needs to be transformed is </p>
  
  <pre><code>SELECT date, product, IF(type = 'msrp', amount, 0) price, 
       IF(type != 'msrp', amount, 0) tax FROM productdetail group by date, product;
  </code></pre>
  
  <p>Please provide the right usage of <strong>if statement</strong> in hibernate criteria.</p>