Skip to content

JPA query with is null and pageable gives InvalidDataAccessResourceUsageException when result size is bigger than page size #3791

@aperreaultaubeupgrade

Description

@aperreaultaubeupgrade

We observe the following behaviour starting with spring-data-jpa 3.3.9. (3.3.8 was fine)

With a JPA query like this

   @Query("""
        SELECT p.id
        FROM Parent p
        WHERE (:ids is null OR p.id IN (:ids))
    """)
    Page<Long> withIds(@Param("ids")List<Long> ids, Pageable pageable);

if the result size is bigger than the Pageable page size it throws

org.springframework.dao.InvalidDataAccessResourceUsageException: No argument for named parameter ':ids_1'

if the result size is smaller than the Pageable page size it behaves like expected.

see this branch to reproduce
https://github.com/spring-projects/spring-data-jpa/compare/3.3.9...aperreaultaubeupgrade:spring-data-jpa:jpa-is-null-pageable-bug?expand=1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions