java-1.8 jooq-3.10.0 SpringBoot-1.5.7
はZonedDateTimeフィールドがDataTypeException
myCondition = create .select(... TABLE_AL.START_DATE.as("table_al_start_date"), TABLE_BR.START_DATE.as("table_br_start_date"))) .from(MAIN).innerJoin(TABLE_AL).onkey() .innerJoin(TABLE_BR).onkey() .where(DSL.trueCondition()); List<MyObject> myObjList = myCondition.fetch().into(MyObject.class)
class MyObject(){ ZonedDateTime tableAlStartDate; ZonedDateTime tableBrStartDate; ... }
table_al_start_date
が
java.time.ZonedDateTime
である私のオブジェクトは、いくつかのテーブルのフィールドを持っている
、PostgreSQL
で timestamp without time zone,nullable
、
会っていデータ型例外は行いますかrownは使用 .select(TABLE_A.START_DATE.as("table_a_start_date").cast(ZonedDateTime.class)
もセッターsetTableAlStartDate(Long long)
を追加しようとしたorg.jooq.exception.SQLDialectNotSupportedException: Type class java.time.ZonedDateTime is not supported in dialect null
を満たしますMyObject
Caused by: org.jooq.exception.DataTypeException: Cannot convert from 1511971200000 (class java.lang.Long) to class java.time.ZonedDateTime at org.jooq.tools.Convert$ConvertAll.fail(Convert.java:1169) at org.jooq.tools.Convert$ConvertAll.toDate(Convert.java:1121) at org.jooq.tools.Convert$ConvertAll.from(Convert.java:823)
場合にフェッチする場合、機能しません。
コンバータが見つかったcustom-bindings、カスタムコンバータを作成した後に何をする必要がありますか。 DataType<LocalDate> type = SQLDataType.DATE.asConvertedDataType(new LocalDateConverter());
これは何ですか?
このZonedDateTime
フィールドとはどうすればよいですか?おかげさまで この良い習慣場合