Having a situation where my java code is symbolic to query -
SELECT CUSTOMER_ID, CUSTOMER_NAME, CASE WHEN COUNT (DISTINCT CARD_ID
Using the Criteria API, you need to order by the caseSelect expression. I gave it a try and it works fine with Hibernate 5.4. Which version do you use?
caseSelect