org.axiondb.engine.commands
Class UpsertCommand
java.lang.Object
org.axiondb.engine.commands.BaseAxionCommand
org.axiondb.engine.commands.UpsertCommand
- All Implemented Interfaces:
- AxionCommand
public class UpsertCommand
- extends BaseAxionCommand
An UPSERT or MERGE command.
- Version:
- $Revision: 1.21 $ $Date: 2004/09/04 01:21:59 $
Methods inherited from class org.axiondb.engine.commands.BaseAxionCommand |
appendBindVariables, assertNotReadOnly, attemptToConvertValue, bind, clearBindings, getEffectedRowCount, getResultSet, getRowIterator, getRowIterator, getTableForIdentifier, resolveSelectableList, resolveSelectableList, setEffectedRowCount, setResultSet |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UpsertCommand
public UpsertCommand()
getAllTables
public TableIdentifier[] getAllTables()
setCondition
public void setCondition(Selectable condition)
setSelectCommand
public void setSelectCommand(SubSelectCommand command)
setUsingSubSelectCommand
public void setUsingSubSelectCommand(SubSelectCommand command)
getSourceTable
public TableIdentifier getSourceTable()
setSourceTable
public void setSourceTable(TableIdentifier table)
getTargetTable
public TableIdentifier getTargetTable()
setTargetTable
public void setTargetTable(TableIdentifier table)
setColumnsForInsert
public void setColumnsForInsert(List columnForInsert)
setValuesForInsert
public void setValuesForInsert(List valuesForInsert)
getInsertColumnIterator
public Iterator getInsertColumnIterator()
getInsertValueIterator
public Iterator getInsertValueIterator()
addUpdateColumn
public void addUpdateColumn(ColumnIdentifier col)
addUpdateValue
public void addUpdateValue(Selectable val)
getUpdateColumnIterator
public Iterator getUpdateColumnIterator()
getUpdateValueIterator
public Iterator getUpdateValueIterator()
setUsingSubSelectAlias
public void setUsingSubSelectAlias(String alias)
getUsingSubSelectAlias
public String getUsingSubSelectAlias()
setExceptionWhenClause
public void setExceptionWhenClause(DMLWhenClause w,
TableIdentifier t,
List cols,
List vals)
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()
postProcess
public void postProcess()
throws AxionException
- Throws:
AxionException
executeQuery
public AxionResultSet executeQuery(Database database)
throws AxionException
- Unsupported, use
executeUpdate(org.axiondb.Database)
instead.
- Returns:
- the generated
ResultSet
- Throws:
UnsupportedOperationException
AxionException
- See Also:
Statement.executeQuery(java.lang.String)
,
PreparedStatement.executeQuery()
execute
public boolean execute(Database database)
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()
getBindVariableIterator
protected Iterator getBindVariableIterator()
- Description copied from class:
BaseAxionCommand
- Returns an
Iterator
over all my BindVariable
s, in the proper
order. Default impl returns empty iterator.
- Overrides:
getBindVariableIterator
in class BaseAxionCommand
getCommitSize
protected int getCommitSize()
throws AxionException
- Throws:
AxionException