diff --git a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java index bfebfe837d..b8d2f84c1f 100644 --- a/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/InsertQueryImpl.java @@ -1144,8 +1144,8 @@ implements Condition and = null; for (Field field : fields) { - Field f = (Field) field; - Condition other = matchByConflictingKey(ctx, f, (Field) map.get(f)); + Field f = (Field) orElse(table().field(field), () -> field); + Condition other = matchByConflictingKey(f, (Field) map.get(f)); and = (and == null) ? other : and.and(other); } @@ -1177,7 +1177,7 @@ implements for (Field field : fields) { Field f = (Field) orElse(table().field(field), () -> field); - Condition other = matchByConflictingKey(ctx, f, s.field(f)); + Condition other = matchByConflictingKey(f, s.field(f)); and = (and == null) ? other : and.and(other); } @@ -1187,8 +1187,8 @@ implements return or; } - private final Condition matchByConflictingKey(Context ctx, Field f, Field v) { - return f.eq(v); + private final Condition matchByConflictingKey(Field field, Field v) { + return field.eq(v); } @Override