Package org.h2.command.ddl
Class AlterTableAlterColumn
java.lang.Object
org.h2.command.Prepared
org.h2.command.ddl.DefineCommand
org.h2.command.ddl.SchemaCommand
org.h2.command.ddl.CommandWithColumns
org.h2.command.ddl.AlterTableAlterColumn
This class represents the statements
ALTER TABLE ADD,
ALTER TABLE ADD IF NOT EXISTS,
ALTER TABLE ALTER COLUMN,
ALTER TABLE ALTER COLUMN SELECTIVITY,
ALTER TABLE ALTER COLUMN SET DEFAULT,
ALTER TABLE ALTER COLUMN DROP DEFAULT,
ALTER TABLE ALTER COLUMN DROP EXPRESSION,
ALTER TABLE ALTER COLUMN SET NULL,
ALTER TABLE ALTER COLUMN DROP NULL,
ALTER TABLE ALTER COLUMN SET VISIBLE,
ALTER TABLE ALTER COLUMN SET INVISIBLE,
ALTER TABLE DROP COLUMN
-
Field Summary
Fields inherited from class org.h2.command.ddl.DefineCommand
transactionalFields inherited from class org.h2.command.Prepared
create, parameters, prepareAlways, session, sqlStatement, sqlTokens -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a column to this table.intgetType()Get the command type as defined in CommandInterfacevoidsetAddAfter(String after) voidsetAddBefore(String before) voidAdd the column as the first column of the table.voidsetBooleanFlag(boolean booleanFlag) voidsetColumnsToRemove(ArrayList<Column> columnsToRemove) voidsetDefaultExpression(Expression defaultExpression) Set default or on update expression.voidsetIfNotExists(boolean ifNotExists) voidsetIfTableExists(boolean b) voidsetNewColumn(Column newColumn) voidsetOldColumn(Column oldColumn) voidsetSelectivity(Expression selectivity) voidsetTableName(String tableName) voidsetType(int type) voidsetUsingExpression(Expression usingExpression) Set using expression.longupdate()Execute the statement.Methods inherited from class org.h2.command.ddl.CommandWithColumns
addConstraintCommand, changePrimaryKeysToNotNull, createConstraints, generateSequences, getPrimaryKeyMethods inherited from class org.h2.command.ddl.SchemaCommand
getSchemaMethods inherited from class org.h2.command.ddl.DefineCommand
isReadOnly, isRetryable, isTransactional, queryMeta, setTransactionalMethods inherited from class org.h2.command.Prepared
checkCanceled, checkParameters, collectDependencies, getCurrentRowNumber, getDatabase, getObjectId, getParameters, getPersistedObjectId, getPlanSQL, getPlanSQL, getSession, getSimpleSQL, getSQL, getSQLTokens, isCacheable, isQuery, isWithParamValues, needRecompile, prepare, query, setCommand, setCurrentRowNumber, setParameterList, setPersistedObjectId, setPrepareAlways, setRow, setSession, setSQL, setWithParamValues, toString
-
Constructor Details
-
AlterTableAlterColumn
-
-
Method Details
-
setIfTableExists
public void setIfTableExists(boolean b) -
setTableName
-
setOldColumn
-
setAddFirst
public void setAddFirst()Add the column as the first column of the table. -
setAddBefore
-
setAddAfter
-
update
public long update()Description copied from class:PreparedExecute the statement. -
setType
public void setType(int type) -
setSelectivity
-
setDefaultExpression
Set default or on update expression.- Parameters:
defaultExpression- default or on update expression
-
setUsingExpression
Set using expression.- Parameters:
usingExpression- using expression
-
setNewColumn
-
getType
public int getType()Description copied from class:PreparedGet the command type as defined in CommandInterface -
setIfNotExists
public void setIfNotExists(boolean ifNotExists) -
addColumn
Description copied from class:CommandWithColumnsAdd a column to this table.- Specified by:
addColumnin classCommandWithColumns- Parameters:
column- the column to add
-
setColumnsToRemove
-
setBooleanFlag
public void setBooleanFlag(boolean booleanFlag)
-