HHH-16276 - More readable exception for non-compliant @OrderBy expressions
This commit is contained in:
parent
eaeb7f38ae
commit
e72d58161c
|
@ -71,7 +71,7 @@ public class ParseTreeVisitor extends OrderingParserBaseVisitor<Object> {
|
||||||
throw new OrderByComplianceViolation(
|
throw new OrderByComplianceViolation(
|
||||||
String.format(
|
String.format(
|
||||||
Locale.ROOT,
|
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(),
|
parsedSpec.expression().getText(),
|
||||||
orderingExpression.toDescriptiveText()
|
orderingExpression.toDescriptiveText()
|
||||||
)
|
)
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class OrderByComplianceTests {
|
||||||
}
|
}
|
||||||
catch (OrderByComplianceViolation exception) {
|
catch (OrderByComplianceViolation exception) {
|
||||||
assertThat( exception.getMessage() ).isEqualTo(
|
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)"
|
"which violates the Jakarta Persistence specification - column reference (last_name)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue