public abstract class BaseAxionCommand extends java.lang.Object implements AxionCommand
AxionCommandimplementation.| Constructor and Description |
|---|
BaseAxionCommand() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertNotReadOnly(Database db)
Throws an
AxionExceptionif the given Databaseis read-only. |
protected java.lang.Object |
attemptToConvertValue(java.lang.Object val,
DataType type,
ColumnIdentifier colid) |
void |
bindAll(java.lang.Object[] vals)
Sets the values of all bind variable within this command.
|
protected void |
buildBindVariables() |
void |
clearBindings()
Clears all bind variables within this command.
|
protected void |
createResolveSelectableVisitor(Database db) |
AxionResultSet |
executeQuery(Database db,
boolean isReadOnly)
Execute an SQL statement that returns a single
ResultSet object
with the given read-only state. |
protected java.util.Iterator |
getBindVariableIterator()
Returns an
Iteratorover all my BindVariables, in the proper
order. |
protected java.util.Iterator |
getBindVariableIterator(Selectable sel) |
java.util.List |
getBindVariables() |
protected FindBindVariableVisitor |
getBindVariableVisitor() |
protected java.util.List |
getColIdentifierList(Table table,
TableIdentifier tid) |
protected int |
getCommitSize(Database db) |
int |
getEffectedRowCount()
Returns the last row count generated by
AxionCommand.execute(org.axiondb.Database) or AxionCommand.executeUpdate(org.axiondb.Database). |
java.sql.ResultSet |
getResultSet()
Returns the last
ResultSet generated by AxionCommand.execute(org.axiondb.Database) or
AxionCommand.executeQuery(org.axiondb.Database). |
protected RowIterator |
getRowIterator(Database db,
TableIdentifier tid,
Table table,
Selectable whereNode,
boolean readOnly,
RowDecorator dec) |
protected RowDecorator |
makeRowDecorator(Table table) |
protected void |
populateDefaultValues(Database db,
Table table,
TableIdentifier tableId,
RowDecorator dec) |
protected boolean |
populateSequenceColumns(Database db,
Table table,
Row row) |
protected void |
resolveGeneratedColumns(Table table,
TableIdentifier tableId,
java.util.List cols) |
protected void |
resolveGeneratedColumns(Table table,
TableIdentifier tableId,
java.util.List cols,
boolean useDefaultValues) |
protected Selectable |
resolveSelectable(Selectable sel,
Database db,
java.util.List selected,
TableIdentifier[] tables) |
protected Selectable |
resolveSelectable(Selectable sel,
Database db,
TableIdentifier[] tables) |
protected void |
resolveSelectableList(java.util.List list,
Database db,
TableIdentifier table) |
protected void |
resolveSelectableList(java.util.List list,
Database db,
TableIdentifier[] tables) |
protected void |
setBindVariableVisitor(FindBindVariableVisitor visitor) |
protected void |
setDeferAllConstraintIfRequired(Table table) |
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(java.sql.ResultSet rset)
If subclasses create a
AxionResultSetupon execution, they
should set it here so that they can support AxionCommand.execute(org.axiondb.Database). |
protected void |
updateGeneratedValues(Database db,
Table table,
TableIdentifier tableId,
Row row) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecute, executeQuery, executeUpdatepublic void bindAll(java.lang.Object[] vals)
throws AxionException
bindAll in interface AxionCommandindex - the one-based index of the variablevalue - the value to bind the variable toAxionExceptionpublic void clearBindings()
throws AxionException
clearBindings in interface AxionCommandAxionExceptionpublic AxionResultSet executeQuery(Database db, boolean isReadOnly) throws AxionException
AxionCommandResultSet object
with the given read-only state.executeQuery in interface AxionCommanddb - Database in which query will be executedisReadOnly - true if statement is read-only, false otherwiseResultSetAxionExceptionpublic java.util.List getBindVariables()
getBindVariables in interface AxionCommandpublic final int getEffectedRowCount()
AxionCommandAxionCommand.execute(org.axiondb.Database) or AxionCommand.executeUpdate(org.axiondb.Database).getEffectedRowCount in interface AxionCommandpublic final java.sql.ResultSet getResultSet()
AxionCommandResultSet generated by AxionCommand.execute(org.axiondb.Database) or
AxionCommand.executeQuery(org.axiondb.Database).getResultSet in interface AxionCommandprotected void assertNotReadOnly(Database db) throws AxionException
AxionExceptionif the given Databaseis read-only.AxionExceptionprotected java.lang.Object attemptToConvertValue(java.lang.Object val,
DataType type,
ColumnIdentifier colid)
throws AxionException
AxionExceptionprotected void buildBindVariables()
protected final void createResolveSelectableVisitor(Database db)
protected java.util.Iterator getBindVariableIterator()
Iteratorover all my BindVariables, in the proper
order. Default impl returns empty iterator.protected java.util.Iterator getBindVariableIterator(Selectable sel)
protected final FindBindVariableVisitor getBindVariableVisitor()
protected java.util.List getColIdentifierList(Table table, TableIdentifier tid) throws AxionException
AxionExceptionprotected int getCommitSize(Database db)
protected RowIterator getRowIterator(Database db, TableIdentifier tid, Table table, Selectable whereNode, boolean readOnly, RowDecorator dec) throws AxionException
AxionExceptionprotected final RowDecorator makeRowDecorator(Table table)
protected void populateDefaultValues(Database db, Table table, TableIdentifier tableId, RowDecorator dec) throws AxionException
AxionExceptionprotected boolean populateSequenceColumns(Database db, Table table, Row row) throws AxionException
AxionExceptionprotected void resolveGeneratedColumns(Table table, TableIdentifier tableId, java.util.List cols) throws AxionException
AxionExceptionprotected void resolveGeneratedColumns(Table table, TableIdentifier tableId, java.util.List cols, boolean useDefaultValues) throws AxionException
AxionExceptionprotected Selectable resolveSelectable(Selectable sel, Database db, java.util.List selected, TableIdentifier[] tables) throws AxionException
AxionExceptionprotected Selectable resolveSelectable(Selectable sel, Database db, TableIdentifier[] tables) throws AxionException
AxionExceptionprotected void resolveSelectableList(java.util.List list,
Database db,
TableIdentifier table)
throws AxionException
AxionExceptionprotected void resolveSelectableList(java.util.List list,
Database db,
TableIdentifier[] tables)
throws AxionException
AxionExceptionprotected final void setBindVariableVisitor(FindBindVariableVisitor visitor)
protected void setDeferAllConstraintIfRequired(Table table)
protected final void setEffectedRowCount(int count)
AxionCommand.execute(org.axiondb.Database)protected final void setResultSet(java.sql.ResultSet rset)
AxionResultSetupon execution, they
should set it here so that they can support AxionCommand.execute(org.axiondb.Database).getResultSet()protected void updateGeneratedValues(Database db, Table table, TableIdentifier tableId, Row row) throws AxionException
AxionException