How to get join with compare MAX value using Spring boot JPA Specification?

Viewed 189
 private Specification<UserEntity> hasMinAvailablePoints(long minPoints) {
   return (root, query, criteriaBuilder) -> {        
   return criteriaBuilder.greaterThanOrEqualTo(
         criteriaBuilder.max(root.join("transactions").get("balance")), minPoints);
    };
 }
    

Above code throws error as below.

Caused by: org.hibernate.exception.GenericJDBCException: could not extract ResultSet\r\n\tat org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java

0 Answers
Related