Skip to content

Sort.and() does not handle TypedSort without explicit order [DATACMNS-1704] #2103

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
spring-projects-issues opened this issue Apr 15, 2020 · 0 comments
Assignees
Labels
type: bug A general bug

Comments

@spring-projects-issues
Copy link

hgarus opened DATACMNS-1704 and commented

This might me misunderstanding the API. I did try to sort by multiple properties doing the following:

Sort<MyEntity> myEntity = Sort.sort(MyEntity.class).by(MyEntity::getProperty1)
    .and(Sort.sort(MyEntity.class).by(MyEntity::getProperty2))

The result is a Sort by property2, looking at the code the reason seems to be Sort.and() accessing Sort.orders directly, which is empty for TypedSort


No further details from DATACMNS-1704

@spring-projects-issues spring-projects-issues added the type: bug A general bug label Dec 30, 2020
mp911de added a commit that referenced this issue Jun 10, 2021
We now retain properly the collection of orders by using accessor methods instead of relying on using the orders field. TypedSort orders are not using the orders field, instead they iterate over recorded persistent property paths.

Closes #2103
Original pull request: #2377.
mp911de added a commit that referenced this issue Jun 10, 2021
We now retain properly the collection of orders by using accessor methods instead of relying on using the orders field. TypedSort orders are not using the orders field, instead they iterate over recorded persistent property paths.

Closes #2103
Original pull request: #2377.
@mp911de mp911de assigned mp911de and unassigned odrotbohm Jun 10, 2021
@mp911de mp911de added this to the 2.4.10 (2020.0.10) milestone Jun 10, 2021
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
3 participants