There's a PR in the works at H2 to support MySQL (and possibly PostgreSQL) enum types. Once that's supported officially, we should support the feature as well in jOOQ:
https://github.com/h2database/h2database/pull/451
Can this be added now that H2 support is released? Trying to switch over generated code using a raw Object,
public final TableField<EntityRecord, Object> STATE =
createField("STATE", org.jooq.impl.DefaultDataType.getDefaultDataType("ENUM"), this, "");
Yes, it will be added in jOOQ 3.11, probably.
I've been scratching my head for two days now because of this. Glad I found this issue.
I'll be following this issue and just use reference table for now.
Unfortunately, this can't be implemented in jOOQ yet as the code generator cannot introspect the H2 enum type easily. I've created a feature request in H2: https://github.com/h2database/h2database/issues/654
Cool, so this addition to the H2 information_schema has been implemented. We'll add support for this feature soon: https://github.com/h2database/h2database/issues/654#event-1343031926
OK, 1.4.197 has been released with enums being listed in the information_schema. We can implement this now.
Currently struggling with this - perhaps a workaround is needed: https://github.com/h2database/h2database/issues/1012
Another potential issue when using enums: https://github.com/h2database/h2database/issues/1016
A working implementation has been added to jOOQ 3.11. Early adopter testing from GitHub master would be very welcome!
I've been looking forward to this for about a year. Any idea when it will be released? :)
Without any major blockers, 3.11 will ship by the end of May 2018 :)
Hello,
i'm trying to use the DDLDatabase generator as describe here with jOOQ 3.11.4 and Java 10.
I have enum in my sql schema, but i have this error during generation :
/org/jooq/impl/GeneratedEnum23734746.java:2: error: cannot find symbol
enum GeneratedEnum23734746 implements org.jooq.EnumType {
^
symbol: class EnumType
location: package org.jooq
/org/jooq/impl/GeneratedEnum23734746.java:4: error: method does not override or implement a method from a supertype
@Override
^
/org/jooq/impl/GeneratedEnum23734746.java:8: error: method does not override or implement a method from a supertype
@Override
^
@quen2404 : Thank you very much for your report. Would you mind creating a new issue with some more details to help reproduce this? I'm particularly interested in the DDL used here.
@lukaseder i created this issue: https://github.com/jOOQ/jOOQ/issues/7813
Most helpful comment
Cool, so this addition to the H2
information_schemahas been implemented. We'll add support for this feature soon: https://github.com/h2database/h2database/issues/654#event-1343031926