Skip to content

Pageable.Sort.Order: NullHandling is not taken into consideration #2222

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
lonely-development opened this issue May 31, 2021 · 1 comment
Closed

Comments

@lonely-development
Copy link

I'm currently trying to build some dynamic rules on how the persistence layer should handle null values (NATIVE, NULLS_FIRST & NULLS_LAST).

While testing I notice that the Order.nullHanding is not taken into consideration when Spring builds a JPA query.

The issue seems to be present when using PagingAndSortingRepository.findAll(Pageable) and when using @Query based repository methods:

    @Query("FROM Entity")
    fun page(pageable: Pageable) : Page<TaskEntity>

For the @Query approach you can check QueryUtils.getOrderClause() to see that Order.nullHandling is completely ignored (not sure about the PagingAndSortingRepository use case).

@schauder
Copy link
Contributor

Duplicate of #1280

@schauder schauder marked this as a duplicate of #1280 May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants