line / kotlin-jdsl

Kotlin library that makes it easy to build and execute queries without generated metamodel
https://kotlin-jdsl.gitbook.io/docs/
Apache License 2.0
692 stars 85 forks source link

findPage에서 Pageable 의 sort NullHandling이 적용되지 않습니다. #761

Closed eezy0 closed 3 weeks ago

eezy0 commented 1 month ago

kotlinJdslJpqlExecutor.findPage(dsl, pageable, init) 함수를 사용하여 페이지네이션과 정렬을 적용하려고 합니다.

페이지네이션과 정렬 자체는 문제가 없는데 정렬에서 NullHandling 값이 적용이 되지 않고있습니다.

예시 pageable

val pageable =
    PageRequest.of(
        0,
        3,
        Sort.by(
            listOf(
                Sort.Order(Sort.Direction.ASC, "name", Sort.NullHandling.NULLS_FIRST)
            )
        )
    )
shouwn commented 1 month ago

eezy0 님 안녕하세요.

Pageable의 NULLS_FIRST는 현재 Spring에서 지원되고 있지 않는 것으로 보입니다. https://github.com/spring-projects/spring-data-jpa/issues/1280

NullHandling을 이용하고 싶으시다면 다음 글들을 참고하셔서 Spring의 Pageable 대신에 Kotlin JDSL을 직접 사용하는 것을 추천드립니다. https://github.com/line/kotlin-jdsl/issues/732#issuecomment-2198209840 https://github.com/line/kotlin-jdsl/issues/745#issuecomment-2260002889

cj848 commented 3 weeks ago

답변이 달린걸로 보이고, 추가 질문이 있으시면 다시 댓글 달아주시면 추가 답변 드리겠습니다 close 하겠습니다.