@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)")),
}
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?