We have a flag governing the identifier style, if this is what's troubling
you in terms of "hard to read":
https://www.jooq.org/doc/latest/manual/sql-building/dsl-context/custom-settings/settings-name-style

Boolean.class isn't valid kotlin. Did you intend to write Boolean::class?
But with the jOOQ API, you'll have to pass Boolean::class.java (in order to
pass a java.lang.Class<?> reference)

On Sun, Sep 1, 2024 at 9:54 PM Nico van de Kamp <[email protected]>
wrote:

> I hava converted with the JooQ converter from SQL to JooQ. After some
> struggling it is working. But I don't like it with, it hard and a lot to
> read like:
> table(unquotedName("tablename")).`as`(unquotedName("zz")),
> and
> field(name("zai2", "a_id")).eq(field(name("zai", "a_id")))
>
> So I have rewritten this like:
> override fun inconsistentCheck(zaakId: ZaakId): Boolean = usingDSL { context
> ->
>
> val ZaakMainAlias = ZAAK.`as`("ZAAK_MAIN")
> val AgendaMainAlias = AGENDA.`as`("AGENDA_MAIN")
> val AgendaItemMainAlias = AGENDA_ITEM.`as`("AGENDA_ITEM_MAIN")
>
> context
> .select(
> `when`(count().gt(0), `val`(true)).otherwise(`val`(false))
> )
> .from(ZaakMainAlias
> ,AgendaMainAlias
> ,AgendaItemMainAlias
> )
> .where(ZaakMainAlias.ID.eq(zaakId.value)
> .and(AgendaMainAlias.ZAAK_ID.eq(ZaakMainAlias.ID))
> .and(AgendaMainAlias.ACTUEEL.eq(inline(true)))
> .and(AgendaItemMainAlias.AGENDA_ID.eq(AgendaMainAlias.ID))
>
> ).fetchOne(0, Boolean.class) == true
> }
>
> But query itself has not been changed, just removing the quoted text.
> Now I get an error "None of the following functions can be called with the
> arguments supplied." (see screenshot.) on
> ).fetchOne(0, Boolean.class) == true
> Why? Ok, the query is transformed from qouted to non-qouted, but still the
> same further!??
>
> What kind of mistake do I maken or do I not understand?
>
> If I look to the screenshot, There is now not a Boolean expected? [image:
> fetchOne Boolean error.png]
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/74a1c2bf-f53c-4bb7-a624-fcff90103f07n%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/74a1c2bf-f53c-4bb7-a624-fcff90103f07n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO5yQTvf0arx0tACEKC8B-fyWRHLiPoEU02UYpK23F0-VQ%40mail.gmail.com.

Reply via email to