title: Hibernate Criteria API Equivalent to Oracle's Decode
body: <p>What would the equivalent of Oracle's <a href="http://www.techonthenet.com/oracle/functions/decode.php" rel="nofollow" title="DECODE&#40;&#41;">DECODE()</a> function be in the Hibernate Criteria API?</p>
  
  <p>An SQL example of what I need to do:</p>
  
  <pre><code>SELECT DECODE(FIRST_NAME, NULL, LAST_NAME, FIRST_NAME) as NAME ORDER BY NAME;
  </code></pre>
  
  <p>Which returns LAST_NAME to NAME in the event that FIRST_NAME is NULL.</p>
  
  <p>I would prefer to use the Criteria API but could use HQL if there's no other way.</p>