Hi Cheolho,

There are some open issues related to using null values inside of row()
expressions, when jOOQ can't infer the data type even if intuitively, it
should work. The workaround is to wrap the null value in DSL.value(null,
dataType), to make sure the right data type is associated with the value.

I hope this helps,
Lukas

On Fri, Oct 1, 2021 at 1:08 PM Cheolho Jeon <[email protected]> wrote:

> Hi Lukas!
> Thank you for serving JOOQ.
>
> I'm using JOOQ for project but I see a problem when I use update statement
> with DSL.row().
> I want to use some nullable property(field) to DSL.row() on update
> statement like this:
> *update(CLAIM)*
> *.set(*
> *    row(CLAIM.DESIRED_DATETIME, ...),*
> *    row(null as LocalDateTime?, ...)*
> *)*
> *...*
>
> But when I run this code I met this error:
> *Caused by: java.lang.IllegalArgumentException: Cannot encode null
> parameter of type java.lang.Object*
> * at
> io.r2dbc.postgresql.codec.DefaultCodecs.encodeNull(DefaultCodecs.java:184)*
>
> I found that this code is run well:
> *update(CLAIM)*
> *.set(*
> *    CLAIM.DESIRED_DATETIME, null as LocalDateTime?*
> *)*
> *...*
>
> But I want to set multiple nullable properties(fields) at once.
> Can you tell me the way resolve this problem?
>
> Thank you.
>
> P.S All code is written by Kotlin.
>
> --
> 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/715359eb-c12b-4676-b671-fd57a6f20140n%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/715359eb-c12b-4676-b671-fd57a6f20140n%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/CAB4ELO4qSkQi_JzXLn-xO1HzuP79f0_rn-B0hUa9_M17nkrYqQ%40mail.gmail.com.

Reply via email to