Came across the same issue today, and as jOOQ features no. 5670 
<> and 5673 
<> seems to keep getting pushed 
back, I implemented a intermediate custom solution (see github 
The CustomDatatypeProcessor takes a java.nio.file.Path, reads it and 
converts record data based on the TableRecord -> Fields -> Converter. 
Reusing will need some changes, mainly in the coerce() method, but maybe 
this will help someone who stumbles upon this thread.


On Friday, November 11, 2016 at 1:01:01 PM UTC+1, Rick Latrine wrote:
> Hi,
> when I have following field definition in a table:
> public final org.jooq.TableField<my.jooq.json.serialize.test.tables.
> records.TestRecord, org.joda.time.DateTime> TIME_UTC
>     = createField("TIME_UTC",
>                   org.jooq.impl.SQLDataType.BIGINT.nullable(false),
>                   this,
>                   null,
>                   new my.jooq.json.serialize.test.converter.
> DateTimeConverter());
> With following Converter:
> public class DateTimeConverter implements Converter<Long, DateTime>
> formatJson returns the field definition:
> ...
> "fields":[{"name":"TIME_UTC","type":"BIGINT"},
> ...
> So far so good, as I assumed that jOOQ would use the underlying database 
> type in order to serialize and deserialize the JSON string easily.
> But the data part looks like this:
> "2016-06-07T09:00:00.000+02:00"
> formatJSON converts the custom data type from the fetched record by using 
> toString().
> (see: in github 
> <>
> )
> I expected the json serializer would use the converter to get the database 
> type back as a Long value.
> Afterwards the deserializer is not able to turn the String value to BIGINT 
> and renders it to a null value.
> My question: is this working as expected, is it a bug or is formatJSON not 
> intended to be used with custom types?
> Thanks in advance
> Rick

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 
For more options, visit

Reply via email to