Il <name/> elemento del tuo <customType/> dovrebbe fare riferimento al <U> digita (tipo di utente) il tuo Converter<T, U>
, non al <T> tipo (tipo di database). Quindi se scrivi questo:
<customTypes>
<customType>
<name>java.sql.Timestamp</name>
<converter>com.plannow.jooq.converters.DateTimeConverter</converter>
</customType>
</customTypes>
Quindi stai solo registrando un Converter<Timestamp, Timestamp> . Prova invece questo:
<customTypes>
<customType>
<name>org.joda.time.DateTime</name>
<converter>com.plannow.jooq.converters.DateTimeConverter</converter>
</customType>
</customTypes>
Nota che il tuo convertitore dovrebbe anche gestire correttamente null valori:
@Override
public DateTime from(Timestamp t) {
return t == null ? null : new DateTime(t);
}
@Override
public Timestamp to(DateTime u) {
return u == null ? null : new Timestamp(u.getMillis());
}