El <name/> elemento de su <customType/> debe hacer referencia al <U> type (tipo de usuario) de su Converter<T, U>
, no al <T> tipo (tipo de base de datos). Así que si escribes esto:
<customTypes>
<customType>
<name>java.sql.Timestamp</name>
<converter>com.plannow.jooq.converters.DateTimeConverter</converter>
</customType>
</customTypes>
Entonces realmente solo estás registrando un Converter<Timestamp, Timestamp> . Prueba esto en su lugar:
<customTypes>
<customType>
<name>org.joda.time.DateTime</name>
<converter>com.plannow.jooq.converters.DateTimeConverter</converter>
</customType>
</customTypes>
Tenga en cuenta que su convertidor también debe manejar correctamente null valores:
@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());
}