I started to migrate a project today from 3.11.11 to 3.12.3 and got some 
test failures. I think I tracked it down to this check 
<https://github.com/jOOQ/jOOQ/blob/version-3.11.11/jOOQ/src/main/java/org/jooq/impl/AbstractField.java#L261-L262>
 
no longer existing in 3.12.3 Specifically we have a DefaultRecordListener 
that sets our standard created_at and modified_at fields on a record. This 
snippet kind of shows what we are doing:

private void setFieldToNow(final Record record, final String fieldName) {
    final Field<?> field = record.field(fieldName);
    if (null != field) {
        final Field<DateTime> fieldToSet = field.cast(DateTime.class);
        record.setValue(fieldToSet, getNowUTC());
    }
}

In version 3.12.3, when it calls record.setValue it returns the following 
error:

java.lang.IllegalArgumentException: Field (cast("public"."person".
"modified_at" as timestamp)) is not contained in Row

When I switch it back to 3.11.11, I do not receive this error and my tests 
pass.

I'm pretty sure I can just workaround this issue by doing the following, 
but I wanted you to be aware.

final Field<DateTime> fieldToSet = (Field<DateTime>)field;
record.setValue(fieldToSet, getNowUTC());

Thanks,
James Lorenzen

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/70b7884a-c60a-4160-acbf-e114c09b1be2%40googlegroups.com.

Reply via email to