Skip to content

Default null ordering not working [DATAJPA-1821] #2110

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 Nov 18, 2020 · 2 comments
Closed

Default null ordering not working [DATAJPA-1821] #2110

spring-projects-issues opened this issue Nov 18, 2020 · 2 comments
Assignees
Labels
status: duplicate A duplicate of another issue type: bug A general bug

Comments

@spring-projects-issues
Copy link

Swapnil Vaidya opened DATAJPA-1821 and commented

I have default null ordering property as 'last' in my Spring Boot Project

hibernate.order_by.default_null_ordering: last

This is not working for the database columns where datatype = text

in POSTGRESQL database.


No further details from DATAJPA-1821

@skrabbenborg
Copy link
Contributor

skrabbenborg commented Jan 13, 2021

How are you calling the repository when you want the sorting to occur? Since sorting is only applied when the method call actually requests sorting.

When I have the following in my application.properties:
spring.jpa.properties.hibernate.order_by.default_null_ordering=first

firstNames with value null are returned first when I call:
repository.findAll(Sort.by(Sort.DEFAULT_DIRECTION, "firstName"));

No sorting occurs when I call:
repository.findAll();

@schauder
Copy link
Contributor

This is a duplicate of #1280 (JPA does not support NULL precedence)

@schauder schauder added the status: duplicate A duplicate of another issue label Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants