EnumConverter for enum *arrays*?

58 views
Skip to first unread message

Gordan Krešić

unread,
Sep 13, 2022, 5:07:34 AM9/13/22
to jOOQ User Group
Is it possible to use jOOQ's org.jooq.impl.EnumConverter for converting columns representing arrays of enum UDTs? If it makes any difference, database is PostgreSQL.

Currently, I'm using forcedType declarations for converting columns of any enum type (snippet from Gradle config):

forcedType {
    types = '(my_enum|MY_ENUM)'
    userType = 'com.foo.MyEnum'
    enumConverter = true
}


This works, as expected.

However, if I try to do the same with arrays (note the underscore - standard PostgreSQL prefix for arrays of certain type):

forcedType {
    types = '_(my_enum|MY_ENUM)'
    userType = 'com.foo.MyEnum'
    enumConverter = true
}


In this case, jOOQ code generator produces code that doesn't compile.

Could org.jooq.ArrayConverter be configured somehow?

Lukas Eder

unread,
Sep 13, 2022, 5:13:42 AM9/13/22
to jooq...@googlegroups.com
Hi Gordan,

Sure, the enumConverter flag could be made array aware. Can you please create a feature request here:

You can pretty much copy paste your email

Thanks,
Lukas

--
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 jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/aedb30ce-c6af-4706-9ab7-de7dd374bf35n%40googlegroups.com.

Gordan Krešić

unread,
Sep 13, 2022, 5:25:48 AM9/13/22
to jooq...@googlegroups.com
Done: https://github.com/jOOQ/jOOQ/issues/13982


On 13. 09. 2022. 11:13, Lukas Eder wrote:
> Hi Gordan,
>
> Sure, the enumConverter flag could be made array aware. Can you please create a feature request here:
> https://github.com/jOOQ/jOOQ/issues/new/choose <https://github.com/jOOQ/jOOQ/issues/new/choose>
>
> You can pretty much copy paste your email
>
> Thanks,
> Lukas
>
> On Tue, Sep 13, 2022 at 11:07 AM Gordan Krešić <gordan...@steatoda.com <mailto:gordan...@steatoda.com>> wrote:
>
> Is it possible to use jOOQ's org.jooq.impl.EnumConverter for converting columns representing arrays of enum UDTs? If it makes any difference, database is PostgreSQL.
>
> Currently, I'm using forcedType declarations for converting columns of any enum type (snippet from Gradle config):
>
> forcedType {
>     types = '(my_enum|MY_ENUM)'
>     userType = 'com.foo.MyEnum'
>     enumConverter = true
> }
>
> This works, as expected.
>
> However, if I try to do the same with arrays (note the underscore - standard PostgreSQL prefix for arrays of certain type):
>
> forcedType {
>     types = '_(my_enum|MY_ENUM)'
>     userType = 'com.foo.MyEnum'
>     enumConverter = true
> }
>
> In this case, jOOQ code generator produces code that doesn't compile.
>
> Could org.jooq.ArrayConverter be configured somehow?
>
> --
> 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 jooq-user+...@googlegroups.com <mailto:jooq-user+...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/aedb30ce-c6af-4706-9ab7-de7dd374bf35n%40googlegroups.com <https://groups.google.com/d/msgid/jooq-user/aedb30ce-c6af-4706-9ab7-de7dd374bf35n%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 jooq-user+...@googlegroups.com <mailto:jooq-user+...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO42vx4wZqUmHTkDTyaNpFiN-3sLSZ4Gzj52L94mVt5WzA%40mail.gmail.com <https://groups.google.com/d/msgid/jooq-user/CAB4ELO42vx4wZqUmHTkDTyaNpFiN-3sLSZ4Gzj52L94mVt5WzA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages