The JPA spec does not allow literals to be used as condition expressions. Take a look at simple_cond_expression of the JPA spec on chapter 4.14 BNF