ORDER BY in Criteria API for a computed column name (by alias)

后端 未结 4 949
广开言路
广开言路 2021-01-26 04:15

Having a situation where my java code is symbolic to query -

  SELECT CUSTOMER_ID,
         CUSTOMER_NAME,
         CASE
             WHEN COUNT (DISTINCT CARD_ID         


        
4条回答
  •  一个人的身影
    2021-01-26 05:06

    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?

提交回复
热议问题