org.jooq.meta.xml.XMLDatabase + MYSQL_5_7 + INT column type

21 views
Skip to first unread message

pavel....@gmail.com

unread,
Feb 6, 2020, 5:00:06 AM2/6/20
to jOOQ User Group
Hello. 
Faced the following issue. When generating jooq classes based on xml file (created with help of https://github.com/ayedo/jooq-modelator plugin), results in invalid type. For instance:

Column:

<column>
<table_catalog></table_catalog>
 
<table_schema>SAMPLE</table_schema>
 
<table_name>TEST</table_name>
 
<column_name>size</column_name>
 
<data_type>int(11)</data_type>
 
<character_maximum_length>0</character_maximum_length>
 
<numeric_precision>10</numeric_precision>
 
<numeric_scale>0</numeric_scale>
 
<ordinal_position>17</ordinal_position>
 
<is_nullable>true</is_nullable>
 
<comment></comment>
</column>


Result:
/**
 * @deprecated Unknown data type. Please define an explicit {@link org.jooq.Binding} to specify how this type should be handled. Deprecation can be turned off using {@literal <deprecationOnUnknownTypes/>} in your code generator configuration.
 */

@java.lang.Deprecated
public final TableField<SerasaNegativeNotationResponseParamsRecord, Object> SIZE = createField(DSL.name("size"), org.jooq.impl.DefaultDataType.getDefaultDataType("\"int(11)\"").nullable(false), this, "");


Instead of



public final TableField<SerasaNegativeNotationResponseParamsRecord, Integer> SIZE = createField(DSL.name("size"), SQLDataType.INTEGER.nullable(false), this, "");


Works just fine with other types, such as bigint etc. Also, works just fine when the source is not xml but MySQL DB.

Environment:
Jooq: 3.12.4
MySQL: 5.7


Does someone faced similar issue and know the solution or. at least workarounds? 




Lukas Eder

unread,
Feb 6, 2020, 5:27:04 AM2/6/20
to jOOQ User Group
Thanks a lot for your report. Looks like a bug. I've created an issue for this:

--
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/6e94a0e2-f3b2-45e5-993c-968aa663c1bb%40googlegroups.com.

pavel....@gmail.com

unread,
Feb 6, 2020, 5:30:51 AM2/6/20
to jOOQ User Group
Thanks a lot!

четверг, 6 февраля 2020 г., 13:27:04 UTC+3 пользователь Lukas Eder написал:
Thanks a lot for your report. Looks like a bug. I've created an issue for this:

To unsubscribe from this group and stop receiving emails from it, send an email to jooq...@googlegroups.com.

Lukas Eder

unread,
Feb 6, 2020, 5:33:54 AM2/6/20
to jOOQ User Group
Note, this is not related to the display width but to the fact that the data type reported here is INT, instead of INTEGER, which is the standard name for 32 bit integers. As a workaround, if you can replace INT(11) by INTEGER(11), or INTEGER, you would get the correct type.

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/9a2995b1-8a2e-4b5f-a9d5-1e64fba1986f%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages