JPA CriteriaQuery: using same expression in select and orderBy I tried to write belowed SQL with CriteriaAPI in Hibernate 6.2.6: