My problem very close the one mentioned in Using UUID PK or FK in Firebird with Jooq
Setup: Jaybird 3.0.5, Firebird 2.5.7, jOOQ 3.11.7, JDK 1.8
My PK and FK fields like
ID CHAR(16) CHARACTER SET OCTETS NOT NULL
and
TABLE_ID CHAR(16) CHARACTER SET OCTETS
and I want to use UUID as java data type in generated classes
I use JDBC connection in configuration like
<jdbc>
<driver>org.firebirdsql.jdbc.FBDriver</driver>
<url>jdbc:firebirdsql:localhost:c:/DBS/DB.FDB?octetsAsBytes=true</url>
<properties>
<property>
<key>user</key>
<value>SYSDBA</value>
</property>
<property>
<key>password</key>
<value>masterkey</value>
</property>
</properties>
</jdbc>
I have setup forcedType in generator like
<forcedType>
<userType>java.util.UUID</userType>
<binding>com.ekser.nakkash.icdv.converters.jooq.ByteArray2UUIDBinding</binding>
<expression>.*ID$</expression>
<types>CHAR\(16\)</types>
<nullability>ALL</nullability>
</forcedType>
and I have class
class ByteArray2UUIDBinding implements Binding<byte[], UUID>
Now the problem
jOOQ generates
public final TableField<MyTableRecord, UUID> ID = createField("ID", org.jooq.impl.SQLDataType.CHAR(16).nullable(false), this, "", new ByteArray2UUIDBinding());
problem is SQLDataType.CHAR(16)
, it should be SQLDataType.BINARY(16)
.
jOOQ translate my char(16) octets
fields as string (char(16)
), it does not respect octetsAsBytes=true
.
I have tried to put it to properties in <jdbc>
like
<jdbc>
<driver>org.firebirdsql.jdbc.FBDriver</driver>
<url>jdbc:firebirdsql:localhost:c:/DBS/DB.FDB</url>
<properties>
<property>
<key>user</key>
<value>SYSDBA</value>
</property>
<property>
<key>password</key>
<value>masterkey</value>
</property>
<property>
<key>octetsAsBytes</key>
<value>true</value>
</property>
</properties>
</jdbc>
With the same result.
What is wrong?
I am considering running search&replace for keyword CHAR(16)
-> BINARY(16)
in generated classes for now, which is not 'stylish'.