I have a complex query created using JPA criteria API that worked on previous versions (tested on 5.3.7 and 5.2.15). It doesn't work on 5.4.0.
The query contains a select case statement inside the select clause, as this simplified example:
The example works when using HQL:
I've attached a simple test case.