I've written an SQL query and put this in the JooQ converter.
I have tried a lot but the Select statement on this moment the issue why it is not correct:
usingDSL { context ->
context.select(
case_()
.when(count().gt(inline(0)), inline(true))
.otherwise(inline(false))
)
I have tried to put in the case_(count()) and then when (true, true), but still an error.
I have tried with else_ (false), is also wrong.
-----
Another thing what I'm asking myself is why is everything quoted when convertedwith the JooQ converter?
Why not just this:
.from(ZAAK).`as`("zz"),
(AGENDA).
`as`("za"),
(AGENDA_ITEM).
`as`("za"),
)
Instead off:
.from(
table(unquotedName("zaak")).`as`(unquotedName("zz")),
table(unquotedName("agenda")).`as`(unquotedName("za")),
table(unquotedName("agenda_item")).`as`(unquotedName("zai"))
"table(unquotedName("zaak")).`as`(unquotedName("zz"))" used.
Everything is quoted also field names like:
.where(field(name("zai2", "agenda_id")).eq(field(name("zai", "agenda_id")))
Why not:
.where(zai2.AGENDA_ID.eq(zai.AGENDA_ID)
This is so hard to read