org.axiondb.engine.commands
Class BaseAxionCommand

java.lang.Object
  extended byorg.axiondb.engine.commands.BaseAxionCommand
All Implemented Interfaces:
AxionCommand
Direct Known Subclasses:
AlterTableCommand, CheckFileStateCommand, ConstraintCommand, CreateCommand, DefragCommand, DeleteCommand, DropCommand, InsertCommand, RemountCommand, SelectCommand, ShutdownCommand, TruncateCommand, UpdateCommand, UpsertCommand

public abstract class BaseAxionCommand
extends Object
implements AxionCommand

Abstract base AxionCommandimplementation.

Version:
$Revision: 1.24 $ $Date: 2004/09/09 23:47:43 $

Constructor Summary
BaseAxionCommand()
           
 
Method Summary
static void appendBindVariables(Selectable sel, List list)
           
protected  void assertNotReadOnly(Database db)
          Throws an AxionExceptionif the given Databaseis read-only.
protected  Object attemptToConvertValue(Object val, DataType type, ColumnIdentifier colid)
           
 void bind(int index, Object value)
          Sets the value of the i th bind variable within this command.
 void clearBindings()
          Clears all bind variables within this command.
protected  Iterator getBindVariableIterator()
          Returns an Iteratorover all my BindVariables, in the proper order.
 int getEffectedRowCount()
          Returns the last row count generated by AxionCommand.execute(org.axiondb.Database) or AxionCommand.executeUpdate(org.axiondb.Database).
 ResultSet getResultSet()
          Returns the last ResultSet generated by AxionCommand.execute(org.axiondb.Database) or AxionCommand.executeQuery(org.axiondb.Database).
protected  RowIterator getRowIterator(Table table, Selectable whereNode, boolean readOnly)
           
protected  RowIterator getRowIterator(Table table, Selectable whereNode, boolean readOnly, RowDecorator dec)
           
protected  Table getTableForIdentifier(Database db, TableIdentifier identifier)
           
protected  void resolveSelectableList(List list, Database db, TableIdentifier table)
           
protected  void resolveSelectableList(List list, Database db, TableIdentifier[] tables)
           
protected  void setEffectedRowCount(int count)
          If sublasses return a number of rows effected, then upon execution, they should set that number here so it can support AxionCommand.execute(org.axiondb.Database)
protected  void setResultSet(ResultSet rset)
          If subclasses create a AxionResultSetupon execution, they should set it here so that they can support AxionCommand.execute(org.axiondb.Database).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.axiondb.AxionCommand
execute, executeQuery, executeUpdate
 

Constructor Detail

BaseAxionCommand

public BaseAxionCommand()
Method Detail

setResultSet

protected void setResultSet(ResultSet rset)
If subclasses create a AxionResultSetupon execution, they should set it here so that they can support AxionCommand.execute(org.axiondb.Database).

See Also:
getResultSet()

getResultSet

public ResultSet getResultSet()
Description copied from interface: AxionCommand
Returns the last ResultSet generated by AxionCommand.execute(org.axiondb.Database) or AxionCommand.executeQuery(org.axiondb.Database).

Specified by:
getResultSet in interface AxionCommand

setEffectedRowCount

protected void setEffectedRowCount(int count)
If sublasses return a number of rows effected, then upon execution, they should set that number here so it can support AxionCommand.execute(org.axiondb.Database)


getEffectedRowCount

public int getEffectedRowCount()
Description copied from interface: AxionCommand
Returns the last row count generated by AxionCommand.execute(org.axiondb.Database) or AxionCommand.executeUpdate(org.axiondb.Database).

Specified by:
getEffectedRowCount in interface AxionCommand

bind

public void bind(int index,
                 Object value)
          throws AxionException
Sets the value of the i th bind variable within this command.

Specified by:
bind in interface AxionCommand
Parameters:
index - the one-based index of the variable
value - the value to bind the variable to
Throws:
AxionException

clearBindings

public void clearBindings()
                   throws AxionException
Clears all bind variables within this command.

Specified by:
clearBindings in interface AxionCommand
Throws:
AxionException

assertNotReadOnly

protected void assertNotReadOnly(Database db)
                          throws AxionException
Throws an AxionExceptionif the given Databaseis read-only.

Throws:
AxionException

getBindVariableIterator

protected Iterator getBindVariableIterator()
Returns an Iteratorover all my BindVariables, in the proper order. Default impl returns empty iterator.


appendBindVariables

public static void appendBindVariables(Selectable sel,
                                       List list)

attemptToConvertValue

protected Object attemptToConvertValue(Object val,
                                       DataType type,
                                       ColumnIdentifier colid)
                                throws AxionException
Throws:
AxionException

getRowIterator

protected RowIterator getRowIterator(Table table,
                                     Selectable whereNode,
                                     boolean readOnly)
                              throws AxionException
Throws:
AxionException

getRowIterator

protected RowIterator getRowIterator(Table table,
                                     Selectable whereNode,
                                     boolean readOnly,
                                     RowDecorator dec)
                              throws AxionException
Throws:
AxionException

getTableForIdentifier

protected Table getTableForIdentifier(Database db,
                                      TableIdentifier identifier)
                               throws AxionException
Throws:
AxionException

resolveSelectableList

protected void resolveSelectableList(List list,
                                     Database db,
                                     TableIdentifier table)
                              throws AxionException
Throws:
AxionException

resolveSelectableList

protected void resolveSelectableList(List list,
                                     Database db,
                                     TableIdentifier[] tables)
                              throws AxionException
Throws:
AxionException