HHH-16276 - More readable exception for non-compliant @OrderBy expressions

This commit is contained in:
Steve Ebersole 2023-03-16 00:38:26 -05:00
parent c7bc5bb6d2
commit 8678c661e6
2 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ public class ParseTreeVisitor extends OrderingParserBaseVisitor<Object> {
throw new OrderByComplianceViolation(
String.format(
Locale.ROOT,
"`@OrderBy` expression (%s) is not a domain-model reference, which violates the Jakarta Persistence specification - %s",
"@OrderBy expression (%s) is not a domain-model reference, which violates the Jakarta Persistence specification - %s",
parsedSpec.expression().getText(),
orderingExpression.toDescriptiveText()
)

View File

@ -42,7 +42,7 @@ public class OrderByComplianceTests {
}
catch (OrderByComplianceViolation exception) {
assertThat( exception.getMessage() ).isEqualTo(
"`@OrderBy` expression (last_name) is not a domain-model reference " +
"@OrderBy expression (last_name) is not a domain-model reference, " +
"which violates the Jakarta Persistence specification - column reference (last_name)"
);
}