79275707

Date: 2024-12-12 15:42:53
Score: 1
Natty:
Report link

In Hibernate prior to version 6.6.1 it seemed to worked as @Dinesh describes.

queryBuilder.desc(root.get("room").get("id")).as(Integer.class))

Since Hibernate 6.6.1 this has changed: https://docs.jboss.org/hibernate/orm/6.6/migration-guide/migration-guide.html#criteria-query

Current usage is following:

((JpaExpression)queryBuilder.desc(root.get("room").get("id"))).cast(Integer.class))
Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Dinesh
  • High reputation (-1):
Posted by: michal.jakubeczy