I'm using model API without code generation and trying to achieve SQL code with the following condition:
WHERE visitor_device in (?)::visitor_device[]
where visitor_device is Postgres enum type. Example java code is:
Set<DeviceType> s = EnumSet.of(MOBILE);
query.addConditions(field("visitor_device").in(devices));
where custom enum DeviceType implements org.jooq.EnumType.
jOOQ correctly obtain enum value using EnumType.getLiteral() method for bind parameter, but the generated array is not cast:
WHERE visitor_device in (?)
It's not a problem if I would need to use String literal directly like this:
Set<DeviceType> s = singleton("mobile");
query.addConditions(field("visitor_device").in(devices));
However I still don't know how I can do the casting to enum array.
Many thanks!