The strings in the criteria query are always transformed into parameters, even if you use CriteriaBuiler#literal(). This implicit parameter binding mechanism of all literals in criteria queries conflicts with the type checking in the SearchedCaseNode. The ParameterNode doesn't carry any data type information.
Ugly workaround, forcing creation of LiteralNode:
Trying to understand. So does this fail on 5.0? your comment makes me think it works.
Steve, this causes the exception in either version:
This is a workaround for both versions (using a number as literal):
This is a workaround only for 5.0.2 (using a Java boolean literal directly instead of wrapped by cb.literal()):
Any chance of having this fixed on 4.3 series?