<name/> prvek vašeho <customType/> by měl odkazovat na <U> typ (typ uživatele) vašeho Converter<T, U>
, nikoli do <T> typ (typ databáze). Takže pokud napíšete toto:
<customTypes>
<customType>
<name>java.sql.Timestamp</name>
<converter>com.plannow.jooq.converters.DateTimeConverter</converter>
</customType>
</customTypes>
Pak už opravdu jen registrujete Converter<Timestamp, Timestamp> . Zkuste toto:
<customTypes>
<customType>
<name>org.joda.time.DateTime</name>
<converter>com.plannow.jooq.converters.DateTimeConverter</converter>
</customType>
</customTypes>
Všimněte si, že váš převodník by měl také správně zpracovat null hodnoty:
@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());
}