org.h2.command.ddl

## Class CommandWithColumns

- java.lang.Object
- - org.h2.command.Prepared
  - - org.h2.command.ddl.DefineCommand
    - - org.h2.command.ddl.SchemaCommand
      - - org.h2.command.ddl.CommandWithColumns

Direct Known Subclasses:
  AlterTableAlterColumn, CreateTable

    public abstract class CommandWithColumns
    extends SchemaCommand

### Field Summary

### Fields inherited from class org.h2.command.ddl.DefineCommand

`transactional`

### Fields inherited from class org.h2.command.Prepared

`create, parameters, prepareAlways, session, sqlStatement`

### Constructor Summary

Constructors
`protected` `CommandWithColumns(Session session, Schema schema)`

### Method Summary

Methods
`abstract void` `addColumn(Column column)` Add a column to this table.
`void` `addConstraintCommand(DefineCommand command)` Add a constraint statement to this statement.
`protected void` `changePrimaryKeysToNotNull(java.util.ArrayList<Column> columns)` For the given list of columns, disable "nullable" for those columns that are primary key columns.
`protected void` `createConstraints()` Create the constraints.
`protected java.util.ArrayList<Sequence>` `generateSequences(java.util.ArrayList<Column> columns, boolean temporary)` For the given list of columns, create sequences for auto-increment columns (if needed), and then get the list of all sequences of the columns.
`AlterTableAddConstraint` `getPrimaryKey()`

### Methods inherited from class org.h2.command.ddl.SchemaCommand

`getSchema`

### Methods inherited from class org.h2.command.ddl.DefineCommand

`isReadOnly, isTransactional, queryMeta, setTransactional`

### Methods inherited from class org.h2.command.Prepared

`checkCanceled, checkParameters, collectDependencies, getCteCleanups, getCurrentRowNumber, getObjectId, getParameters, getPersistedObjectId, getPlanSQL, getSession, getSimpleSQL, getSQL, getSQL, getType, isCacheable, isQuery, needRecompile, prepare, query, setCommand, setCteCleanups, setCurrentRowNumber, setParameterList, setPersistedObjectId, setPrepareAlways, setRow, setSession, setSQL, toString, update`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### CommandWithColumns

    protected CommandWithColumns(Session session,
                      Schema schema)

### Method Detail

#### addColumn

    public abstract void addColumn(Column column)

Add a column to this table.

Parameters:
  `column` - the column to add

#### addConstraintCommand

    public void addConstraintCommand(DefineCommand command)

Add a constraint statement to this statement. The primary key definition is one possible constraint statement.

Parameters:
  `command` - the statement to add

#### changePrimaryKeysToNotNull

    protected void changePrimaryKeysToNotNull(java.util.ArrayList<Column> columns)

For the given list of columns, disable "nullable" for those columns that are primary key columns.

Parameters:
  `columns` - the list of columns

#### createConstraints

    protected void createConstraints()

Create the constraints.

#### generateSequences

    protected java.util.ArrayList<Sequence> generateSequences(java.util.ArrayList<Column> columns,
                                                  boolean temporary)

For the given list of columns, create sequences for auto-increment columns (if needed), and then get the list of all sequences of the columns.

Parameters:
  `columns` - the columns
  `temporary` - whether generated sequences should be temporary
Returns:
  the list of sequences (may be empty)

#### getPrimaryKey

    public AlterTableAddConstraint getPrimaryKey()