title: COALESCE in JPA namedQuery
body: <p>I have the following namedQuery</p>
  
  <pre><code>select new test.entity.Emp(COALESCE(k.projectId,'N')
  as projectId, k.projectName) from Emp o inner join o.projects k 
  </code></pre>
  
  <p>However I am getting error</p>
  
  <blockquote>
    <p>expecting RIGHT_ROUND_BRACKET, found '('</p>
  </blockquote>
  
  <p>How to handle <code>COALESCE</code> in namedQuery?</p>
  
  <p>Are there any other ways to handle null values in JPA?</p>