Automatic CASE WHEN wrapping of boolean expressions
We should add support for plain boolean expressions in entity view mappings like e.g.:
@Mapping("age > 10")
Since JPQL does not support plain boolean expressions in select items, the user currently needs to manually formulate such mappings as CASE WHEN:
@Mapping("CASE WHEN age > 10 THEN true ELSE false END")
This CASE WHEN wrapping should happen automatically.
Actually I think we should do this in core already instead. Entity views should not have to change anything and only the final JPQL output should show the transformed expression.
Maybe we can also allow boolean expressions such as x OR y without having to write x = true OR y = true.
Although well aware of this limitation, I recently stumbled upon this again by surprise with a x IN (subquery) expression and a SUM(x) IS NOT NULL NULL expression in the select clause.