Hi Stan,

Thanks for your message. The easiest way forward in these cases is to use
the code generator that is built into jOOQ. It will generate those
VARCHAR.asEnumDataType() mappings for you, so you will never need to
remember them.

If you cannot or do not want to use the code generator, then you will need
to do the exact same thing as the code generator would have done, manually.
Your usage of the API is correct, you somehow have to tell the jOOQ runtime
API that what appears to be a VARCHAR type is really an enum type, in case
of which jOOQ will be able to generate the necessary cast for you.

I hope this helps,
Lukas

2017-12-06 18:26 GMT+01:00 Stan Svec <[email protected]>:

> I fixed it currently by converting custom Java enum instances into enum
> data type fields before passing them into in(..) method:
> public Set<Field<VisitorDevice>> getVisitorDevicesAsEnumDataType() {
>   return visitorDevices.stream().map(dev -> cast(dev, PostgresDataType.
> VARCHAR.asEnumDataType(VisitorDevice.class))).collect(toSet());
> }
>
>
> --
> 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].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to