Reject Limit parameter using String-based queries.

Document limitations, add test cases for derived queries.

Closes #1654
This commit is contained in:
Mark Paluch
2023-11-02 09:26:43 +01:00
parent 4ceb982197
commit 5312731623
8 changed files with 124 additions and 24 deletions

View File

@@ -100,6 +100,21 @@ public class StringBasedR2dbcQuery extends AbstractR2dbcQuery {
this.expressionQuery = ExpressionQuery.create(query);
this.binder = new ExpressionEvaluatingParameterBinder(expressionQuery, dataAccessStrategy);
this.expressionDependencies = createExpressionDependencies();
if (method.isSliceQuery()) {
throw new UnsupportedOperationException(
"Slice queries are not supported using string-based queries; Offending method: " + method);
}
if (method.isPageQuery()) {
throw new UnsupportedOperationException(
"Page queries are not supported using string-based queries; Offending method: " + method);
}
if (method.getParameters().hasLimitParameter()) {
throw new UnsupportedOperationException(
"Queries with Limit are not supported using string-based queries; Offending method: " + method);
}
}
private ExpressionDependencies createExpressionDependencies() {