<名前/>コード> の要素 を参照する必要があります Converter
、 ではありません タイプ(データベースタイプ)。したがって、これを書くと:
<customTypes>
<customType>
<name>java.sql.Timestamp</name>
<converter>com.plannow.jooq.converters.DateTimeConverter</converter>
</customType>
</customTypes>
次に、実際には Converter を登録するだけです。 。代わりにこれを試してください:
<customTypes>
<customType>
<name>org.joda.time.DateTime</name>
<converter>com.plannow.jooq.converters.DateTimeConverter</converter>
</customType>
</customTypes>
コンバーターはnullも正しく処理する必要があることに注意してください 値:
@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());
}