[jOOQ/jOOQ#11817] Trial and error until Java 8 stops complaining

This commit is contained in:
Lukas Eder 2021-04-29 13:22:54 +02:00
parent d85c1490e6
commit aca781ca5b

View File

@ -423,15 +423,15 @@ public class UpdatableRecordImpl<R extends UpdatableRecord<R>> extends TableReco
refresh(refreshFields.toArray(EMPTY_FIELD));
}
// Cast is needed in Java 8 it seems
@SuppressWarnings({ "unchecked", "rawtypes", "cast" })
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public final R copy() {
// [#3359] The "fetched" flag must be set to false to enforce INSERT statements on
// subsequent store() calls - when Settings.updatablePrimaryKeys is set.
return Tools.newRecord(false, getTable(), configuration())
.operate(copy -> {
// R vs Record casting is needed in Java 8 it seems
return (R) Tools.newRecord(false, (Table<Record>) (Table) getTable(), configuration())
.operate((Record copy) -> {
// Copy all fields. This marks them all as isChanged, which is important
List<TableField<R, ?>> key = getPrimaryKey().getFields();