Skip to content
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

Problem with PagingAndSortingRepository in Spring Boot 2.7.5? #33253

Closed
kentsecureappbox opened this issue Nov 18, 2022 · 2 comments
Closed

Problem with PagingAndSortingRepository in Spring Boot 2.7.5? #33253

kentsecureappbox opened this issue Nov 18, 2022 · 2 comments
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@kentsecureappbox
Copy link

kentsecureappbox commented Nov 18, 2022

We have this repository & method declared in our system:

public interface ImportBatchRowsRepository extends PagingAndSortingRepository<ImportBatchRow, String> {
...
    @Query("select row from ImportBatchRow row where row.importBatch = :importBatch AND"
            + " (COALESCE( null, :statuses ) is null or row.status in (:statuses))  AND "
            + "(:searchLike IS NULL OR row.description LIKE :searchLike OR row.rowData LIKE :searchLike)")
    Page<ImportBatchRow> findByImportBatch(
            @Param("importBatch") ImportBatch importBatch,
            @Param("statuses") List<ImportBatchRowStatus> statuses,
            @Param("searchLike") String searchLike,
            Pageable pageable);

With 2.7.4, the call findByImportBatch(batch, null, null, pageRequest) succeds and returns a list of rows.
With 2.7.5 the same call returns an empty list.

Not sure if we are using this improperly, but don't think so, so will report this as a potential bug.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 18, 2022
@wilkinsona
Copy link
Member

Thanks for the report but the functionality of PagingAndSortingRepository and @Query is part of Spring Data which is managed as a number of separate projects. It looks like you're using Spring Data JPA so Hibernate may also be a factor. Spring Boot 2.7.5 upgraded to Hibernate 5.6.12.Final from 5.6.11.Final. You may want to try downgrading back to 5.6.11.Final to see if Hibernate is the cause of the problem. If the problem still occurs with Hibernate 5.6.11, you may want to open a Spring Data JPA issue.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2022
@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 18, 2022
@kentsecureappbox
Copy link
Author

kentsecureappbox commented Nov 18, 2022

Sorry, my misstake, I thought I was following a link to Spring Data JPA project and didn't see that it was wrong, filed an issue on the Spring Data JPA project now instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants