-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Spring Data JPA sorting with NullHandling parameter #26172
Labels
area/panache
area/spring
Issues relating to the Spring integration
kind/enhancement
New feature or request
Milestone
Comments
/cc @geoand |
geoand
added
kind/enhancement
New feature or request
and removed
kind/bug
Something isn't working
labels
Jun 20, 2022
Thanks for reporting! I'll try and have a look next week |
@Sgitario would you be interested in taking a look at this? |
Sgitario
added a commit
to Sgitario/quarkus
that referenced
this issue
Jun 28, 2022
Allow users sorting by either nulls first or nulls last. Example of usage: ```java Sort.by("foo", Sort.Direction.Ascending, Sort.NullHandling.NULLS_FIRST); ``` (See more examples in tests) This PR also adds support of nulls handling for the Spring Data JPA Quarkus extension: it translates the Spring Sort object to the new Panache Sort object. Finally, as the Panache Sort API is also used by the Mongo Quarkus extension and Mongo does not easily support sorting by nulls, I decided to simply print a WARNING message if users try to use it. Fix quarkusio#26172
Sgitario
added a commit
to Sgitario/quarkus
that referenced
this issue
Jun 28, 2022
Allow users sorting by either nulls first or nulls last. Example of usage: ```java Sort.by("foo", Sort.Direction.Ascending, Sort.NullHandling.NULLS_FIRST); ``` (See more examples in tests) This PR also adds support of nulls handling for the Spring Data JPA Quarkus extension: it translates the Spring Sort object to the new Panache Sort object. Finally, as the Panache Sort API is also used by the Mongo Quarkus extension and Mongo does not easily support sorting by nulls, I decided to simply print a WARNING message if users try to use it. Fix quarkusio#26172
Sgitario
added a commit
to Sgitario/quarkus
that referenced
this issue
Jul 1, 2022
Allow users sorting by either nulls first or nulls last. Example of usage: ```java Sort.by("foo", Sort.Direction.Ascending, Sort.NullHandling.NULLS_FIRST); ``` (See more examples in tests) This PR also adds support of nulls handling for the Spring Data JPA Quarkus extension: it translates the Spring Sort object to the new Panache Sort object. Finally, as the Panache Sort API is also used by the Mongo Quarkus extension and Mongo does not easily support sorting by nulls, I decided to simply print a WARNING message if users try to use it. Fix quarkusio#26172
Sgitario
added a commit
to Sgitario/quarkus
that referenced
this issue
Jul 1, 2022
Allow users sorting by either nulls first or nulls last. Example of usage: ```java Sort.by("foo", Sort.Direction.Ascending, Sort.NullPrecedence.NULLS_FIRST); ``` (See more examples in tests) This PR also adds support of nulls handling for the Spring Data JPA Quarkus extension: it translates the Spring Sort object to the new Panache Sort object. Finally, as the Panache Sort API is also used by the Mongo Quarkus extension and Mongo does not easily support sorting by nulls, I decided to simply print a WARNING message if users try to use it. Fix quarkusio#26172
Sgitario
added a commit
to Sgitario/quarkus
that referenced
this issue
Jul 1, 2022
Allow users sorting by either nulls first or nulls last. Example of usage: ```java Sort.by("foo", Sort.Direction.Ascending, Sort.NullPrecedence.NULLS_FIRST); ``` (See more examples in tests) This PR also adds support of nulls handling for the Spring Data JPA Quarkus extension: it translates the Spring Sort object to the new Panache Sort object. Finally, as the Panache Sort API is also used by the Mongo Quarkus extension and Mongo does not easily support sorting by nulls, I decided to simply print a WARNING message if users try to use it. Fix quarkusio#26172
Sgitario
added a commit
to Sgitario/quarkus
that referenced
this issue
Jul 1, 2022
Allow users sorting by either nulls first or nulls last. Example of usage: ```java Sort.by("foo", Sort.Direction.Ascending, Sort.NullPrecedence.NULLS_FIRST); ``` (See more examples in tests) This PR also adds support of nulls handling for the Spring Data JPA Quarkus extension: it translates the Spring Sort object to the new Panache Sort object. Finally, as the Panache Sort API is also used by the Mongo Quarkus extension and Mongo does not easily support sorting by nulls, I decided to simply print a WARNING message if users try to use it. Fix quarkusio#26172
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/panache
area/spring
Issues relating to the Spring integration
kind/enhancement
New feature or request
Describe the bug
While using Spring Data JPA extension and its Sorting and Pageable API, I encountered an issue with NullHandling parameter. It looks like it is ignored while constructing SQL query.
I would expect
NULLS LAST
directive to be added beforelimit
in this case. I guess this is something from Spring API that was overlooked, or perhaps I am not using it correctly.Expected behavior
Constructed SQL query to look something like this:
Actual behavior
Constructed SQL query looks like this:
How to Reproduce?
No response
Output of
uname -a
orver
Darwin my-hostname 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64
Output of
java -version
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.9.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.3
Additional information
No response
The text was updated successfully, but these errors were encountered: