📘
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. FAQ

How can I see the generated query?

Kotlin JDSL prints queries and parameters generated by DSL to the debug log. So you can see it by changing the log level of the com.linecorp.kotlinjdsl package to debug.

Because the parameters contained in the log are printed through the toString function, it can be difficult to identify the values unless toString function is overridden.

select(
    path(Book::isbn),
).from(
    entity(Book::class),
).where(
    path(Book::publishDate).between(
        OffsetDateTime.parse("2023-01-01T00:00:00+09:00"),
        OffsetDateTime.parse("2023-06-30T23:59:59+09:00"),
    ),
).orderBy(
    path(Book::isbn).asc(),
)
2023-01-01T00:00:00.000+09:00 DEBUG c.l.kotlinjdsl.render.jpql.JpqlRenderer  : The query is rendered.
SELECT Book.isbn FROM Book AS Book WHERE Book.publishDate BETWEEN :param1 AND :param2 ORDER BY Book.isbn ASC
{param1=2023-01-01T00:00+09:00, param2=2023-06-30T23:59:59+09:00}
PreviousKotlin JDSL RoadmapNextHow can I use Kotlin value class?

Last updated 1 year ago

Was this helpful?