[#5055] Add CreateTableColumnStep.column(Field<?>) for convenience
This commit is contained in:
parent
c122a176ec
commit
b7d0776c66
@ -70,6 +70,16 @@ public interface CreateTableAsStep<R extends Record> {
|
||||
@Support({ CUBRID, DERBY, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
CreateTableOnCommitStep as(Select<? extends R> select);
|
||||
|
||||
/**
|
||||
* Add a column to the column list of the <code>CREATE TABLE</code>
|
||||
* statement.
|
||||
* <p>
|
||||
* This is the same as calling {@link #column(Field, DataType)} with
|
||||
* {@link Field#getDataType()} as the argument data type.
|
||||
*/
|
||||
@Support
|
||||
CreateTableColumnStep column(Field<?> field);
|
||||
|
||||
/**
|
||||
* Add a column to the column list of the <code>CREATE TABLE</code> statement.
|
||||
*/
|
||||
|
||||
@ -47,6 +47,16 @@ package org.jooq;
|
||||
*/
|
||||
public interface CreateTableColumnStep extends CreateTableConstraintStep {
|
||||
|
||||
/**
|
||||
* Add a column to the column list of the <code>CREATE TABLE</code>
|
||||
* statement.
|
||||
* <p>
|
||||
* This is the same as calling {@link #column(Field, DataType)} with
|
||||
* {@link Field#getDataType()} as the argument data type.
|
||||
*/
|
||||
@Support
|
||||
CreateTableColumnStep column(Field<?> field);
|
||||
|
||||
/**
|
||||
* Add a column to the column list of the <code>CREATE TABLE</code> statement.
|
||||
*/
|
||||
|
||||
@ -128,6 +128,12 @@ class CreateTableImpl<R extends Record> extends AbstractQuery implements
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public final CreateTableColumnStep column(Field<?> field) {
|
||||
return column((Field) field, field.getDataType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <T> CreateTableColumnStep column(Field<T> field, DataType<T> type) {
|
||||
columnFields.add(field);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user