title: Using if else statement for named query?
body: <pre><code>@NamedQueries(  
     {   
   @NamedQuery(name = "GetAvailableProducts", query = new StringBuilder("").append("SELECT p   FROM Product p WHERE p.type= :type AND (p.available = 'ALL' OR").append(isTest() ? "(p.available = 'TEST' OR)"  : " ").append("p.available = :available)")),  
   }
  </code></pre>
  
  <p>This gives me an error it can't recognize the isTest() method. Instead of this method if I put an if statement as lik if(1==1) or something like that, it says "Attribute must be constans" in Intellij IDEA. How to solve?</p>