I have a problem with conversion of java.time.Instant
and java.time.LocalDateTime
to SQL Timestamp using JOOQ.
Currently I am populating field as:
setField(MODIFIED_AT_FIELD_NAME, Instant.now(), tableRecord);
During the debugging I can see that field’s value has correct precision in milliseconds.
However, generated JOOQ createField looks like:
public final TableField<PolicyRecord, LocalDateTime> MODIFIED_DATE = createField(DSL.name("modified_date"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field(DSL.raw("current_timestamp()"), SQLDataType.LOCALDATETIME)), this, "");
And inserted value in the database TIMESTAMP column does not have milliseconds precision.
Note that standard SQL command stores value with milliseconds precision, so my assumption is JOOQ is somehow rounding the value.
Is there a way to configure JOOQ to keep precision in format of TIMESTAMP(6)?
user3801003 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.