[#8276] Add overloads CreateTableColumnStep.columns(Name...) and columns(String...)

This commit is contained in:
lukaseder 2019-01-31 16:50:52 +01:00
parent ca46ecdc23
commit 9fa671e6e8
2 changed files with 32 additions and 0 deletions

View File

@ -102,6 +102,28 @@ public interface CreateTableColumnStep extends CreateTableAsStep<Record>, Create
@Support
CreateTableColumnStep columns(Field<?>... fields);
/**
* Add several columns to the column list of the <code>CREATE TABLE</code>
* statement.
* <p>
* This is the same as calling {@link #column(Field, DataType)} for each
* column. Lacking an explicit data type, this makes sense only for a
* <code>CREATE TABLE AS SELECT...</code> statement.
*/
@Support
CreateTableColumnStep columns(Name... fields);
/**
* Add several columns to the column list of the <code>CREATE TABLE</code>
* statement.
* <p>
* This is the same as calling {@link #column(Field, DataType)} for each
* column. Lacking an explicit data type, this makes sense only for a
* <code>CREATE TABLE AS SELECT...</code> statement.
*/
@Support
CreateTableColumnStep columns(String... fields);
/**
* Add several columns to the column list of the <code>CREATE TABLE</code>
* statement.

View File

@ -210,6 +210,16 @@ final class CreateTableImpl extends AbstractQuery implements
return columns(Arrays.asList(fields));
}
@Override
public final CreateTableImpl columns(Name... fields) {
return columns(Tools.fieldsByName(fields));
}
@Override
public final CreateTableImpl columns(String... fields) {
return columns(Tools.fieldsByName(fields));
}
@Override
public final CreateTableImpl columns(Collection<? extends Field<?>> fields) {
for (Field<?> field : fields)