org.axiondb.engine.commands
Class AlterTableCommand
java.lang.Object
org.axiondb.engine.commands.BaseAxionCommand
org.axiondb.engine.commands.AlterTableCommand
- All Implemented Interfaces:
- AxionCommand
public class AlterTableCommand
- extends BaseAxionCommand
A ALTER TABLE tableName ADD | DROP |ALTER column definition command.
NOTE: Identity column can't be altered.
NOTE: Renaming column require cascade to drop constraints and indexes and then rename
TODO: ADD [COLUMN] .... [BEFORE ]
- Version:
- $Revision: 1.12 $ $Date: 2007/11/13 19:04:02 $
Constructor Summary |
AlterTableCommand(java.lang.String theTableName,
boolean cascade)
|
Method Summary |
void |
addChildCommand(AxionCommand cmd)
|
void |
addColumn(java.lang.String name,
java.lang.String type,
java.lang.String precision,
java.lang.String scale,
Selectable defaultValue,
java.lang.String generated)
|
void |
alterColumn(java.lang.String name,
java.lang.String newName,
Selectable newDefault,
java.lang.Boolean dropDefault)
|
void |
dropColumn(java.lang.String colName)
|
boolean |
execute(Database db)
Executes an SQL statement that may return multiple results. |
AxionResultSet |
executeQuery(Database database)
Unsupported |
int |
executeUpdate(Database db)
Executes an SQL that may add, delete or modify zero or more rows within the
database, such as an INSERT, UPDATE or DELETE statement. |
void |
setRenameTo(java.lang.String newName)
|
Methods inherited from class org.axiondb.engine.commands.BaseAxionCommand |
assertNotReadOnly, attemptToConvertValue, bindAll, buildBindVariables, clearBindings, createResolveSelectableVisitor, executeQuery, getBindVariableIterator, getBindVariableIterator, getBindVariables, getBindVariableVisitor, getColIdentifierList, getCommitSize, getEffectedRowCount, getResultSet, getRowIterator, makeRowDecorator, populateDefaultValues, populateSequenceColumns, resolveGeneratedColumns, resolveGeneratedColumns, resolveSelectable, resolveSelectable, resolveSelectableList, resolveSelectableList, setBindVariableVisitor, setDeferAllConstraintIfRequired, setEffectedRowCount, setResultSet, updateGeneratedValues |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AlterTableCommand
public AlterTableCommand(java.lang.String theTableName,
boolean cascade)
addChildCommand
public void addChildCommand(AxionCommand cmd)
addColumn
public void addColumn(java.lang.String name,
java.lang.String type,
java.lang.String precision,
java.lang.String scale,
Selectable defaultValue,
java.lang.String generated)
alterColumn
public void alterColumn(java.lang.String name,
java.lang.String newName,
Selectable newDefault,
java.lang.Boolean dropDefault)
dropColumn
public void dropColumn(java.lang.String colName)
execute
public boolean execute(Database db)
throws AxionException
- Description copied from interface:
AxionCommand
- Executes an SQL statement that may return multiple results.
- Returns:
- true if one or more
ResultSet
s were generated,
false otherwise
- Throws:
AxionException
- See Also:
Statement.execute(java.lang.String)
,
PreparedStatement.execute()
executeQuery
public AxionResultSet executeQuery(Database database)
throws AxionException
- Unsupported
- Returns:
- the generated
ResultSet
- Throws:
AxionException
- See Also:
Statement.executeQuery(java.lang.String)
,
PreparedStatement.executeQuery()
executeUpdate
public int executeUpdate(Database db)
throws AxionException
- Description copied from interface:
AxionCommand
- Executes an SQL that may add, delete or modify zero or more rows within the
database, such as an INSERT, UPDATE or DELETE statement. In addition, SQL
statements that return nothing, such as SQL DDL statements, can be executed via
this method.
- Returns:
- the number of rows modified
- Throws:
AxionException
- See Also:
Statement.executeUpdate(java.lang.String)
,
PreparedStatement.executeUpdate()
setRenameTo
public void setRenameTo(java.lang.String newName)