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

Support of Sort.NullHandling from Spring #732

Closed
mikoaj-pe opened this issue Jun 28, 2024 · 2 comments
Closed

Support of Sort.NullHandling from Spring #732

mikoaj-pe opened this issue Jun 28, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@mikoaj-pe
Copy link

Hi
I don't know if you are aware of this, but the findPage(pageable: Pageable) method does not fully cope with Sort from Spring. It manages to pass the direction and parameter name to the query, but loses information about NullHandling somewhere (NULLS_LAST etc.). So when I build Pageable with Sort looking like Sort.by(Order(DESC, "createdAt", NULLS_LAST)) - in query I only see "order by *.createdAt desc"

So I don't know if it's a bug or not yet implemented feature but I just want to let you know

@shouwn shouwn added the question Further information is requested label Jun 29, 2024
@shouwn shouwn self-assigned this Jun 29, 2024
@shouwn
Copy link
Member

shouwn commented Jun 29, 2024

Hi mikoaj-pe.

I didn't realize this didn't work, my guess is that Spring doesn't support nulls_first or nulls_last yet.
spring-projects/spring-data-jpa#1280

When I looked at the code in Spring, it also didn't support this yet.
image

Probably because the Criteria API does not yet define interfaces for nulls_first or nulls_last.

Since Spring doesn't support it, it's unlikely that Kotlin JDSL will support it either.

If you want to use nulls_first or nulls_last, I recommend using the nullsFirst and nullsLast methods provided by Kotlin JDSL to handle them.
image

@shouwn
Copy link
Member

shouwn commented Jul 19, 2024

I'll close this issue as there is no further conversation, but please reopen it if you need to discuss further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants