-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override query limit in R2dbcEntityTemplate.selectOne
only if the query has no limit
#758
Comments
We could make the limit override conditional and set the limit only if it wasn't already set. |
R2dbcEntityTemplate.selectOne
only if the query has no limit
Yes, that would be the expected behavior. |
Do you want to submit a pull request including test cases? |
Please have a look at the PR spring-projects/spring-data-relational#1233 I implemented it for the |
Thanks a lot. The change in Happy to merge the Template API part though. |
I understand the argument that the developers my use
|
We strive to have strict API guarantees. Reacting to the query limit as in the pull request is already widening what the methods are capable of. On the other side, the R2DBC part is more strict than e.g. the MongoDB Template API which already returns the first result without checking whether a query would yield more results. |
ok. I removed the changes to |
Using
selectOne
on a query with multiple results obviously throws a "non unique result" exception. When the query is limited to 1, it still throws:In the query log I see that the limit is set to 2 instead of 1.
This makes me think it's a bug because the limit seems to be ignored?
The text was updated successfully, but these errors were encountered: