[jOOQ/jOOQ#11275] NullPointerException when using InsertSetStep.set(Map) on plain SQL table with plain SQL field names
This commit is contained in:
parent
9d1d5ac261
commit
72e0a123a7
@ -5333,13 +5333,22 @@ final class Tools {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up a field in a table, or create a new qualified field from the table.
|
||||
*/
|
||||
static final Field<?> tableField(Table<?> table, Object field) {
|
||||
if (field instanceof Field<?>)
|
||||
return (Field<?>) field;
|
||||
else if (field instanceof Name)
|
||||
return table.field((Name) field);
|
||||
if (table.fieldsRow().size() == 0)
|
||||
return DSL.field(table.getQualifiedName().append(((Name) field).unqualifiedName())) ;
|
||||
else
|
||||
return table.field((Name) field);
|
||||
else if (field instanceof String)
|
||||
return table.field((String) field);
|
||||
if (table.fieldsRow().size() == 0)
|
||||
return DSL.field(table.getQualifiedName().append((String) field));
|
||||
else
|
||||
return table.field((String) field);
|
||||
else
|
||||
throw new IllegalArgumentException("Field type not supported: " + field);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user