Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Jun 15, 2021

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

mp911de added 2 commits June 15, 2021 09:48
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.
@mp911de mp911de added the type: bug A general bug label Jun 15, 2021
@mp911de mp911de added this to the 2.5.2 (2021.0.2) milestone Jun 15, 2021
@mp911de mp911de requested a review from christophstrobl June 15, 2021 08:16
@mp911de mp911de changed the title Fix result sorting using Redis repository query methods. Fix result sorting using Redis repository query methods Jun 15, 2021
----
interface PersonRepository extends RedisRepository<Person, String> {

List<Person> findByFirstnameSortByAgeDesc(String firstname); <1>

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.

Copy link
Member Author

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.

christophstrobl pushed a commit that referenced this pull request Jun 18, 2021
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
christophstrobl added a commit that referenced this pull request Jun 18, 2021
Fix sorting query part that should be 'orderBy'.

Original Pull Request: #2087
christophstrobl pushed a commit that referenced this pull request Jun 18, 2021
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
Original Pull Request: #2087
christophstrobl added a commit that referenced this pull request Jun 18, 2021
Fix sorting query part that should be 'orderBy'.

Original Pull Request: #2087
@christophstrobl
Copy link
Member

merged to 2.5.x and forward ported to master

@christophstrobl christophstrobl deleted the issue/2080 branch June 18, 2021 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants