📘
Kotlin JDSL
Discord
en
en
  • Kotlin JDSL
  • JPQL with Kotlin JDSL
    • Statements
    • Entities
    • Paths
    • Expressions
    • Predicates
    • Sorts
    • Subqueries
    • Custom DSL
    • Spring supports
    • Migration 2.X to 3.X
  • Kotlin JDSL Roadmap
  • FAQ
    • How can I see the generated query?
    • How can I use Kotlin value class?
    • What is the difference between Kotlin JDSL and jOOQ and QueryDSL?
    • Why is there a support module that only has a nullable return type
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. JPQL with Kotlin JDSL

Sorts

PreviousPredicatesNextSubqueries

Last updated 1 year ago

Was this helpful?

Kotlin JDSL has Sort interface to represent an order-by item in JPQL. To build Sort, you can use asc() and desc() after .

path(Book::isbn).asc()

path(Book::isbn).desc()

Null order

Calling nullsFirst() or nullsLast() on Sort allows to specify where null values appear in an ordered result.

path(Employee::nickname).asc().nullsFirst()

path(Employee::nickname).asc().nullsLast()
Expression