org.axiondb.engine.commands
Class SubSelectCommand

java.lang.Object
  extended by org.axiondb.engine.commands.BaseAxionCommand
      extended by org.axiondb.engine.commands.SelectCommand
          extended by org.axiondb.engine.commands.SubSelectCommand
All Implemented Interfaces:
Serializable, AxionCommand, Selectable

public class SubSelectCommand
extends SelectCommand
implements Selectable

A Sub SELECT query used for view, scalar value, from node, row list

Version:
$Revision: 1.6 $ $Date: 2004/09/09 23:47:43 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.axiondb.engine.commands.SelectCommand
_context, _currentDatabase, _planner
 
Constructor Summary
SubSelectCommand(AxionQueryContext context)
           
 
Method Summary
protected  void buildTableList(Database db)
           
 Object evaluate(RowDecorator row)
           
 boolean execute(Database database)
          Executes an SQL statement that may return multiple results.
 AxionResultSet executeQuery(Database db)
          Execute this command, returning a ResultSet.
 int executeUpdate(Database database)
          Unsupported
 String getAlias()
           
 DataType getDataType()
           
 String getLabel()
           
 String getName()
           
 RowIterator getRowIterator(Database db)
          Return RowIterator that can used for other commands for sub-query.
 RowIterator getRowIterator(Database db, RowDecorator rowDec)
           
 Table getTableView(Database db, String name)
          Return TableView a table wrapper to hold sub-query RowIterator.
 Table getUpdatableTableView(Database db)
           
 Table getUpdatableTableView(Database db, String name)
           
 boolean isScalarSelect()
           
 RowIterator makeRowIterator(Database db)
           
 void setAlias(String aliasName)
           
 void setDB(Database db)
           
 void setEvaluteAsScalarValue()
           
 void setParentTables(TableIdentifier[] tables)
           
 void setVariableContext(VariableContext context)
           
 
Methods inherited from class org.axiondb.engine.commands.SelectCommand
getBindVariableIterator, getColumnIdToFieldMap, getQueryContext, makeRowIterator, resolve, toString
 
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, wait, wait, wait
 

Constructor Detail

SubSelectCommand

public SubSelectCommand(AxionQueryContext context)
Method Detail

evaluate

public Object evaluate(RowDecorator row)
                throws AxionException
Specified by:
evaluate in interface Selectable
Throws:
AxionException

execute

public boolean execute(Database database)
                throws AxionException
Description copied from interface: AxionCommand
Executes an SQL statement that may return multiple results.

Specified by:
execute in interface AxionCommand
Overrides:
execute in class SelectCommand
Returns:
true if one or more ResultSets were generated, false otherwise
Throws:
AxionException
See Also:
Statement.execute(java.lang.String), PreparedStatement.execute()

executeQuery

public AxionResultSet executeQuery(Database db)
                            throws AxionException
Description copied from class: SelectCommand
Execute this command, returning a ResultSet.

Specified by:
executeQuery in interface AxionCommand
Overrides:
executeQuery in class SelectCommand
Returns:
the ResultSetgenerated by this command.
Throws:
AxionException
See Also:
Statement.executeQuery(java.lang.String), PreparedStatement.executeQuery()

executeUpdate

public int executeUpdate(Database database)
                  throws AxionException
Description copied from class: SelectCommand
Unsupported

Specified by:
executeUpdate in interface AxionCommand
Overrides:
executeUpdate in class SelectCommand
Returns:
the number of rows modified
Throws:
AxionException
See Also:
Statement.executeUpdate(java.lang.String), PreparedStatement.executeUpdate()

getAlias

public String getAlias()
Specified by:
getAlias in interface Selectable

getDataType

public DataType getDataType()
Specified by:
getDataType in interface Selectable

getLabel

public String getLabel()
Specified by:
getLabel in interface Selectable

getName

public String getName()
Specified by:
getName in interface Selectable

getRowIterator

public RowIterator getRowIterator(Database db)
                           throws AxionException
Return RowIterator that can used for other commands for sub-query.

Returns:
the RowIterator.
Throws:
AxionException

getRowIterator

public RowIterator getRowIterator(Database db,
                                  RowDecorator rowDec)
                           throws AxionException
Throws:
AxionException

getTableView

public Table getTableView(Database db,
                          String name)
                   throws AxionException
Return TableView a table wrapper to hold sub-query RowIterator.

Returns:
the TableView.
Throws:
AxionException

getUpdatableTableView

public Table getUpdatableTableView(Database db)
                            throws AxionException
Throws:
AxionException

getUpdatableTableView

public Table getUpdatableTableView(Database db,
                                   String name)
                            throws AxionException
Throws:
AxionException

isScalarSelect

public boolean isScalarSelect()

makeRowIterator

public RowIterator makeRowIterator(Database db)
                            throws AxionException
Overrides:
makeRowIterator in class SelectCommand
Throws:
AxionException

setAlias

public void setAlias(String aliasName)

setDB

public void setDB(Database db)

setEvaluteAsScalarValue

public void setEvaluteAsScalarValue()

setParentTables

public void setParentTables(TableIdentifier[] tables)

setVariableContext

public void setVariableContext(VariableContext context)
Specified by:
setVariableContext in interface Selectable

buildTableList

protected void buildTableList(Database db)
                       throws AxionException
Overrides:
buildTableList in class SelectCommand
Throws:
AxionException