-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix result sorting using Redis repository query methods #2087
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
Conversation
We now correctly apply sorting when calling a repository query method with a Sort parameter or when defining the sort order as part of the method name.
---- | ||
interface PersonRepository extends RedisRepository<Person, String> { | ||
|
||
List<Person> findByFirstnameSortByAgeDesc(String firstname); <1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be OrderBy
instead of SortBy
? The former is what the unit test uses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. This snippet originates from the MongoDB documentation that needs to be updated as well. Also, we should document the OrderBy
keyword in the table of supported keywords.
We now correctly apply sorting when calling a repository query method with a Sort parameter or when defining the sort order as part of the method name. Original Pull Request: #2087
Fix sorting query part that should be 'orderBy'. Original Pull Request: #2087
Fix sorting query part that should be 'orderBy'. Original Pull Request: #2087
merged to 2.5.x and forward ported to master |
We now correctly apply sorting when calling a repository query method with a Sort parameter or when defining the sort order as part of the method name.
Closes #2080