title: Case condition in hql
body: <p>What I'm trying to achieve with this query is: always do the &quot;mother&quot; conditional, but if there isn't mother, then do the &quot;dad&quot; conditional, is this posible?</p>
  <pre><code>&quot;select name from Person where idParents = :idParents and&quot;
                          + &quot; CASE &quot; + 
                          &quot;       WHEN idMother !=NULL THEN idMother = :idMother &quot; + 
                          &quot;       ELSE idFather = :idFather &quot; + 
                          &quot;   END&quot;;
  </code></pre>