79701648

Date: 2025-07-15 06:32:50
Score: 0.5
Natty:
Report link

So, it turned out that the problem was in the multiline string literal for query.

@Query("""
    SELECT
        u.customerId AS customerId,
        r.id.amountThreshold AS amountThreshold,
        SUM(r.amount) AS amount
    FROM RecordEntity r
    JOIN UserEntity u ON r.id.accountNumber = u.accountNumber
    WHERE u.customerId IN ?1
    GROUP BY u.customerId, r.id.amountThreshold
    ORDER BY u.customerId, r.id.amountThreshold
""")

Looks like Hibernate adds special characters somewhere inside and then cannot recognize aliases..

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Roman