Skip to content

SortBy stop working on Spring boot 2.5.13 #2537

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
luitas opened this issue May 19, 2022 · 2 comments
Closed

SortBy stop working on Spring boot 2.5.13 #2537

luitas opened this issue May 19, 2022 · 2 comments
Labels
in: query-parser Everything related to parsing JPQL or SQL type: bug A general bug

Comments

@luitas
Copy link

luitas commented May 19, 2022

On 2.5.12 spring boot it works but in 2.5.13 not working
In my case if i have

pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by(Sort.Direction.DESC, "inserted"));
return dataRecordRepository.findAllByFilter(pageable,1);

and in repository

@Query("select r From DataRecord r " +
            "  " +
            "where " +
                    " ( " +
            "       r.adusrId = :userId " +
            "       or EXISTS( select 1 FROM DataRecordDvsRight dr WHERE dr.adusrId = :userId AND dr.dataRecord = r ) " +
            ")")
    Page<DataRecord> findAllByFilter(Pageable pageable, @Param("userId") Long userId);

I get an error:
Invalid path: 'dr.inserted' [select r From com.algoritmusistemos.media.app.entity.DataRecord r where ( r.adusrId = :userId or EXISTS( select 1 FROM com.algoritmusistemos.media.app.entity.DataRecordDvsRight dr WHERE dr.adusrId = :userId AND dr.dataRecord = r ) ) order by dr.inserted desc]

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 19, 2022
@schauder
Copy link
Contributor

This sounds like a duplicate of #2496

@schauder schauder added the in: query-parser Everything related to parsing JPQL or SQL label May 19, 2022
gregturn added a commit that referenced this issue May 19, 2022
By properly parsing "order by" clauses, Spring Data JPA can apply sorting parameters to the end of queries in the event of complex queries that involve nested subselects.

Closes ##2496, #2522, #2537, #2045.
gregturn added a commit that referenced this issue May 19, 2022
By properly parsing "order by" clauses, Spring Data JPA can apply sorting parameters to the end of queries in the event of complex queries that involve nested subselects.

Closes ##2496, #2522, #2537, #2045.
gregturn added a commit that referenced this issue May 19, 2022
By properly parsing "order by" clauses, Spring Data JPA can apply sorting parameters to the end of queries in the event of complex queries that involve nested subselects.

Closes ##2496, #2522, #2537, #2045.
gregturn added a commit that referenced this issue May 19, 2022
By properly parsing "order by" clauses, Spring Data JPA can apply sorting parameters to the end of queries in the event of complex queries that involve nested subselects.

Closes ##2496, #2522, #2537, #2045.
@gregturn gregturn added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels May 19, 2022
@gregturn gregturn added this to the 3.0 M5 (2022.0.0) milestone May 19, 2022
gregturn added a commit that referenced this issue May 19, 2022
By properly parsing "order by" clauses, Spring Data JPA can apply sorting parameters to the end of queries in the event of complex queries that involve nested subselects.

Closes ##2496, #2522, #2537, #2045.
gregturn added a commit that referenced this issue May 19, 2022
By properly parsing "order by" clauses, Spring Data JPA can apply sorting parameters to the end of queries in the event of complex queries that involve nested subselects.

Closes ##2496, #2522, #2537, #2045.
@gregturn
Copy link
Contributor

Backported to 2.7.x and 2.6.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: query-parser Everything related to parsing JPQL or SQL type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants