org.apache.derby.impl.sql.execute
Class GenericResultSetFactory

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.GenericResultSetFactory
All Implemented Interfaces:
ResultSetFactory

public class GenericResultSetFactory
extends java.lang.Object
implements ResultSetFactory

ResultSetFactory provides a wrapper around all of the result sets used in this execution implementation. This removes the need of generated classes to do a new and of the generator to know about all of the result sets. Both simply know about this interface to getting them.

In terms of modularizing, we can create just an interface to this class and invoke the interface. Different implementations would get the same information provided but could potentially massage/ignore it in different ways to satisfy their implementations. The practicality of this is to be seen.

The cost of this type of factory is that once you touch it, you touch *all* of the possible result sets, not just the ones you need. So the first time you touch it could be painful ... that might be a problem for execution.

Author:
ames

Field Summary
 
Fields inherited from interface org.apache.derby.iapi.sql.execute.ResultSetFactory
MODULE
 
Constructor Summary
GenericResultSetFactory()
           
 
Method Summary
 NoPutResultSet getAnyResultSet(NoPutResultSet source, Activation activation, GeneratedMethod emptyRowFun, int resultSetNumber, int subqueryNumber, int pointOfAttachment, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
          An any result set iterates over its source, returning a row with all columns set to nulls if the source returns no rows.
private static Authorizer getAuthorizer(Activation activation)
           
 NoPutResultSet getBulkTableScanResultSet(long conglomId, int scociItem, Activation activation, GeneratedMethod resultRowAllocator, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, java.lang.String tableName, java.lang.String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, int rowsPerRead, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          Table/Index scan where rows are read in bulk
 ResultSet getCallStatementResultSet(GeneratedMethod methodCall, Activation activation)
          A call statement result set simply reports that it completed.
 NoPutResultSet getCurrentOfResultSet(java.lang.String cursorName, Activation activation, int resultSetNumber, java.lang.String psName)
          A current of result set forms a result set on the current row of an open cursor.
 ResultSet getDDLResultSet(Activation activation)
          Generic DDL result set creation.
 ResultSet getDeleteCascadeResultSet(NoPutResultSet source, Activation activation, int constantActionItem, ResultSet[] dependentResultSets, java.lang.String resultSetId)
          A delete Cascade result set simply reports that it completed, and the number of rows deleted.
 ResultSet getDeleteCascadeUpdateResultSet(NoPutResultSet source, GeneratedMethod checkGM, Activation activation, int constantActionItem, int rsdItem)
          An update result set simply reports that it completed, and the number of rows updated.
 ResultSet getDeleteResultSet(NoPutResultSet source, Activation activation)
          A delete result set simply reports that it completed, and the number of rows deleted.
 ResultSet getDeleteVTIResultSet(NoPutResultSet source, Activation activation)
          A delete VTI result set simply reports that it completed, and the number of rows deleted.
 NoPutResultSet getDistinctGroupedAggregateResultSet(NoPutResultSet source, boolean isInSortedOrder, int aggregateItem, int orderItem, Activation activation, GeneratedMethod rowAllocator, int maxRowSize, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A DistinctGroupedAggregateResultSet computes scalar aggregates when at least one of them is a distinct aggregate.
 NoPutResultSet getDistinctScalarAggregateResultSet(NoPutResultSet source, boolean isInSortedOrder, int aggregateItem, int orderItem, Activation activation, GeneratedMethod rowAllocator, int maxRowSize, int resultSetNumber, boolean singleInputRow, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A DistinctScalarAggregateResultSet computes scalar aggregates when at least one of them is a distinct aggregate.
 NoPutResultSet getDistinctScanResultSet(long conglomId, int scociItem, Activation activation, GeneratedMethod resultRowAllocator, int resultSetNumber, int hashKeyColumn, java.lang.String tableName, java.lang.String indexName, boolean isConstraint, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          a distinct scan generator, for ease of use at present.
 NoPutResultSet getGroupedAggregateResultSet(NoPutResultSet source, boolean isInSortedOrder, int aggregateItem, int orderItem, Activation activation, GeneratedMethod rowAllocator, int maxRowSize, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A GroupedAggregateResultSet computes non-distinct grouped aggregates.
 NoPutResultSet getHashJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod joinClause, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A hash join.
 NoPutResultSet getHashLeftOuterJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod joinClause, int resultSetNumber, GeneratedMethod emptyRowFun, boolean wasRightOuterJoin, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A left outer join using a hash join.
 NoPutResultSet getHashScanResultSet(long conglomId, int scociItem, Activation activation, GeneratedMethod resultRowAllocator, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] scanQualifiers, Qualifier[][] nextQualifiers, int initialCapacity, float loadFactor, int maxCapacity, int hashKeyColumn, java.lang.String tableName, java.lang.String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          a hash scan generator, for ease of use at present.
 NoPutResultSet getHashTableResultSet(NoPutResultSet source, Activation activation, GeneratedMethod singleTableRestriction, Qualifier[][] equijoinQualifiers, GeneratedMethod projection, int resultSetNumber, int mapRefItem, boolean reuseResult, int keyColItem, boolean removeDuplicates, long maxInMemoryRowCount, int initialCapacity, float loadFactor, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A hash table result set builds a hash table on its source, applying a list of predicates, if any, to the source, when building the hash table.
 NoPutResultSet getIndexRowToBaseRowResultSet(long conglomId, int scociItem, Activation a, NoPutResultSet source, GeneratedMethod resultRowAllocator, int resultSetNumber, java.lang.String indexName, int heapColRefItem, int indexColRefItem, int indexColMapItem, GeneratedMethod restriction, boolean forUpdate, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          An index row to base row result set gets an index row from its source and uses the RowLocation in its last column to get the row from the base conglomerate.
 ResultSet getInsertResultSet(NoPutResultSet source, GeneratedMethod checkGM, Activation activation)
          An insert result set simply reports that it completed, and the number of rows inserted.
 ResultSet getInsertVTIResultSet(NoPutResultSet source, NoPutResultSet vtiRS, Activation activation)
          An insert VTI result set simply reports that it completed, and the number of rows inserted.
 NoPutResultSet getLastIndexKeyResultSet(Activation activation, int resultSetNumber, GeneratedMethod resultRowAllocator, long conglomId, java.lang.String tableName, java.lang.String indexName, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A last index key sresult set returns the last row from the index in question.
 NoPutResultSet getMaterializedResultSet(NoPutResultSet source, Activation activation, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A ResultSet which materializes the underlying ResultSet tree into a temp table on the 1st open.
 ResultSet getMiscResultSet(Activation activation)
          Generic Misc result set creation.
 NoPutResultSet getNestedLoopJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod joinClause, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A nested loop left outer join result set forms a result set on top of 2 other result sets.
 NoPutResultSet getNestedLoopLeftOuterJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod joinClause, int resultSetNumber, GeneratedMethod emptyRowFun, boolean wasRightOuterJoin, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A nested loop join result set forms a result set on top of 2 other result sets.
 NoPutResultSet getNormalizeResultSet(NoPutResultSet source, Activation activation, int resultSetNumber, int erdNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, boolean forUpdate, GeneratedMethod closeCleanup)
          REMIND: needs more description...
 NoPutResultSet getOnceResultSet(NoPutResultSet source, Activation activation, GeneratedMethod emptyRowFun, int cardinalityCheck, int resultSetNumber, int subqueryNumber, int pointOfAttachment, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
          A once result set iterates over its source, raising an error if the source returns > 1 row and returning a row with all columns set to nulls if the source returns no rows.
 NoPutResultSet getProjectRestrictResultSet(NoPutResultSet source, Activation activation, GeneratedMethod restriction, GeneratedMethod projection, int resultSetNumber, GeneratedMethod constantRestriction, int mapRefItem, boolean reuseResult, boolean doesProjection, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A project restrict result set iterates over its source, evaluating a restriction and when it is satisfied, constructing a row to return in its result set based on its projection.
 NoPutResultSet getRaDependentTableScanResultSet(long conglomId, int scociItem, Activation activation, GeneratedMethod resultRowAllocator, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, java.lang.String tableName, java.lang.String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup, java.lang.String parentResultSetId, long fkIndexConglomId, int fkColArrayItem, int rltItem)
          a referential action dependent table scan generator.
 NoPutResultSet getRowResultSet(Activation activation, GeneratedMethod row, boolean canCacheRow, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A row result set forms a result set on a single, known row value.
 NoPutResultSet getScalarAggregateResultSet(NoPutResultSet source, boolean isInSortedOrder, int aggregateItem, int orderItem, Activation activation, GeneratedMethod rowAllocator, int maxRowSize, int resultSetNumber, boolean singleInputRow, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A ScalarAggregateResultSet computes non-distinct scalar aggregates.
 NoPutResultSet getScrollInsensitiveResultSet(NoPutResultSet source, Activation activation, int resultSetNumber, int sourceRowWidth, boolean scrollable, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A ResultSet which provides the insensitive scrolling functionality for the underlying result set by materializing the underlying ResultSet tree into a hash table while scrolling forward.
 ResultSet getSetTransactionResultSet(Activation activation)
           
 NoPutResultSet getSortResultSet(NoPutResultSet source, boolean distinct, boolean isInSortedOrder, int orderItem, Activation activation, GeneratedMethod rowAllocator, int maxRowSize, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A sort result set sorts its source and if requested removes duplicates.
 NoPutResultSet getTableScanResultSet(long conglomId, int scociItem, Activation activation, GeneratedMethod resultRowAllocator, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, java.lang.String tableName, java.lang.String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          a minimal table scan generator, for ease of use at present.
 NoPutResultSet getUnionResultSet(NoPutResultSet leftResultSet, NoPutResultSet rightResultSet, Activation activation, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          a minimal union scan generator, for ease of use at present.
 ResultSet getUpdateResultSet(NoPutResultSet source, GeneratedMethod checkGM, Activation activation)
          An update result set simply reports that it completed, and the number of rows updated.
 ResultSet getUpdateVTIResultSet(NoPutResultSet source, Activation activation)
           
 NoPutResultSet getVTIResultSet(Activation activation, GeneratedMethod row, int resultSetNumber, GeneratedMethod constructor, java.lang.String javaClassName, Qualifier[][] pushedQualifiers, int erdNumber, boolean version2, boolean reuseablePs, int ctcNumber, boolean isTarget, int scanIsolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost, GeneratedMethod closeCleanup)
          A VTI result set wraps a user supplied result set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericResultSetFactory

public GenericResultSetFactory()
Method Detail

getInsertResultSet

public ResultSet getInsertResultSet(NoPutResultSet source,
                                    GeneratedMethod checkGM,
                                    Activation activation)
                             throws StandardException
Description copied from interface: ResultSetFactory
An insert result set simply reports that it completed, and the number of rows inserted. It does not return rows. The insert has been completed once the insert result set is available.

Specified by:
getInsertResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be inserted into the target table.
checkGM - The code to enforce the check constraints, if any
activation - the activation for this result set,
Returns:
the insert operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getInsertResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.sql.Activation)

getInsertVTIResultSet

public ResultSet getInsertVTIResultSet(NoPutResultSet source,
                                       NoPutResultSet vtiRS,
                                       Activation activation)
                                throws StandardException
Description copied from interface: ResultSetFactory
An insert VTI result set simply reports that it completed, and the number of rows inserted. It does not return rows. The insert has been completed once the insert result set is available.

Specified by:
getInsertVTIResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be inserted into the target table.
vtiRS - The code to instantiate the VTI, if necessary
activation - the activation for this result set,
Returns:
the insert VTI operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getInsertVTIResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation)

getDeleteVTIResultSet

public ResultSet getDeleteVTIResultSet(NoPutResultSet source,
                                       Activation activation)
                                throws StandardException
Description copied from interface: ResultSetFactory
A delete VTI result set simply reports that it completed, and the number of rows deleted. It does not return rows. The delete has been completed once the delete result set is available.

Specified by:
getDeleteVTIResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be inserted into the target table.
activation - the activation for this result set,
Returns:
the delete VTI operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getDeleteVTIResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation)

getDeleteResultSet

public ResultSet getDeleteResultSet(NoPutResultSet source,
                                    Activation activation)
                             throws StandardException
Description copied from interface: ResultSetFactory
A delete result set simply reports that it completed, and the number of rows deleted. It does not return rows. The delete has been completed once the delete result set is available.

Specified by:
getDeleteResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be deleted from the target table. This result set must contain one column which provides RowLocations that are valid in the target table.
activation - the activation for this result set
Returns:
the delete operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getDeleteResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation)

getDeleteCascadeResultSet

public ResultSet getDeleteCascadeResultSet(NoPutResultSet source,
                                           Activation activation,
                                           int constantActionItem,
                                           ResultSet[] dependentResultSets,
                                           java.lang.String resultSetId)
                                    throws StandardException
Description copied from interface: ResultSetFactory
A delete Cascade result set simply reports that it completed, and the number of rows deleted. It does not return rows. The delete has been completed once the delete result set is available.

Specified by:
getDeleteCascadeResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be deleted from the target table.
activation - the activation for this result set
constantActionItem - a constant action saved object reference
dependentResultSets - an array of DeleteCascade Resultsets for the current table referential action dependents tables.
resultSetId - an Id which is used to store the refence to the temporary result set created of the materilized rows.Dependent table resultsets uses the same id to access their parent temporary result sets.
Returns:
the delete operation as a delete cascade result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getDeleteCascadeResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation, int, org.apache.derby.iapi.sql.ResultSet[], java.lang.String)

getUpdateResultSet

public ResultSet getUpdateResultSet(NoPutResultSet source,
                                    GeneratedMethod checkGM,
                                    Activation activation)
                             throws StandardException
Description copied from interface: ResultSetFactory
An update result set simply reports that it completed, and the number of rows updated. It does not return rows. The update has been completed once the update result set is available.

Specified by:
getUpdateResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be updated in the target table. This result set must contain a column which provides RowLocations that are valid in the target table, and new values to be placed in those rows.
checkGM - The code to enforce the check constraints, if any
activation - the activation for this result set
Returns:
the update operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getUpdateResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.sql.Activation)

getUpdateVTIResultSet

public ResultSet getUpdateVTIResultSet(NoPutResultSet source,
                                       Activation activation)
                                throws StandardException
Specified by:
getUpdateVTIResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be updated in the target table.
activation - the activation for this result set
Returns:
the update operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getUpdateVTIResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation)

getDeleteCascadeUpdateResultSet

public ResultSet getDeleteCascadeUpdateResultSet(NoPutResultSet source,
                                                 GeneratedMethod checkGM,
                                                 Activation activation,
                                                 int constantActionItem,
                                                 int rsdItem)
                                          throws StandardException
Description copied from interface: ResultSetFactory
An update result set simply reports that it completed, and the number of rows updated. It does not return rows. The update has been completed once the update result set is available.

Specified by:
getDeleteCascadeUpdateResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be updated in the target table. This result set must contain a column which provides RowLocations that are valid in the target table, and new values to be placed in those rows.
checkGM - The code to enforce the check constraints, if any
activation - the activation for this result set
constantActionItem - a constant action saved object reference
rsdItem - result Description, saved object id.
Returns:
the update operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getDeleteCascadeUpdateResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.sql.Activation, int, int)

getCallStatementResultSet

public ResultSet getCallStatementResultSet(GeneratedMethod methodCall,
                                           Activation activation)
                                    throws StandardException
Description copied from interface: ResultSetFactory
A call statement result set simply reports that it completed. It does not return rows.

Specified by:
getCallStatementResultSet in interface ResultSetFactory
Parameters:
methodCall - a reference to a method in the activation for the method call
activation - the activation for this result set
Returns:
the call statement operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getCallStatementResultSet(org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.sql.Activation)

getProjectRestrictResultSet

public NoPutResultSet getProjectRestrictResultSet(NoPutResultSet source,
                                                  Activation activation,
                                                  GeneratedMethod restriction,
                                                  GeneratedMethod projection,
                                                  int resultSetNumber,
                                                  GeneratedMethod constantRestriction,
                                                  int mapRefItem,
                                                  boolean reuseResult,
                                                  boolean doesProjection,
                                                  double optimizerEstimatedRowCount,
                                                  double optimizerEstimatedCost,
                                                  GeneratedMethod closeCleanup)
                                           throws StandardException
Description copied from interface: ResultSetFactory
A project restrict result set iterates over its source, evaluating a restriction and when it is satisfied, constructing a row to return in its result set based on its projection. The rows can be constructed as they are requested from the result set.

Specified by:
getProjectRestrictResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be filtered by this operation.
activation - the activation for this result set, against whcih the restriction and projection are performed and to which current rows must be assigned for the projection and restriction to be performed.
restriction - a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the restriction is satisfied or not. The signature of this method is Boolean restriction() throws StandardException;
projection - a reference to a method in the activation that is applied to the activation's "current row" field to project out the expected result row. The signature of this method is ExecRow projection() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
constantRestriction - a reference to a method in the activation that represents a constant expression (eg where 1 = 2). The signature of this method is Boolean restriction() throws StandardException;
mapRefItem - Item # for mapping of source to target columns
doesProjection - Whether or not this PRN does a projection
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the project restrict operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getProjectRestrictResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getHashTableResultSet

public NoPutResultSet getHashTableResultSet(NoPutResultSet source,
                                            Activation activation,
                                            GeneratedMethod singleTableRestriction,
                                            Qualifier[][] equijoinQualifiers,
                                            GeneratedMethod projection,
                                            int resultSetNumber,
                                            int mapRefItem,
                                            boolean reuseResult,
                                            int keyColItem,
                                            boolean removeDuplicates,
                                            long maxInMemoryRowCount,
                                            int initialCapacity,
                                            float loadFactor,
                                            double optimizerEstimatedRowCount,
                                            double optimizerEstimatedCost,
                                            GeneratedMethod closeCleanup)
                                     throws StandardException
Description copied from interface: ResultSetFactory
A hash table result set builds a hash table on its source, applying a list of predicates, if any, to the source, when building the hash table. It then does a look up into the hash table on a probe. The rows can be constructed as they are requested from the result set.

Specified by:
getHashTableResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be filtered by this operation.
activation - the activation for this result set, against whcih the restriction and projection are performed and to which current rows must be assigned for the projection and restriction to be performed.
singleTableRestriction - restriction, if any, applied to input of hash table.
equijoinQualifiers - Qualifier[] for look up into hash table
projection - a reference to a method in the activation that is applied to the activation's "current row" field to project out the expected result row. The signature of this method is ExecRow projection() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
reuseResult - Whether or not to reuse the result row.
keyColItem - Item for hash key column array
removeDuplicates - Whether or not to remove duplicates when building the hash table
maxInMemoryRowCount - Max size of in-memory hash table
initialCapacity - initialCapacity for java.util.HashTable
loadFactor - loadFactor for java.util.HashTable
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the project restrict operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getHashTableResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.services.loader.GeneratedMethod, int, int, boolean, int, boolean, long, int, float, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getSortResultSet

public NoPutResultSet getSortResultSet(NoPutResultSet source,
                                       boolean distinct,
                                       boolean isInSortedOrder,
                                       int orderItem,
                                       Activation activation,
                                       GeneratedMethod rowAllocator,
                                       int maxRowSize,
                                       int resultSetNumber,
                                       double optimizerEstimatedRowCount,
                                       double optimizerEstimatedCost,
                                       GeneratedMethod closeCleanup)
                                throws StandardException
Description copied from interface: ResultSetFactory
A sort result set sorts its source and if requested removes duplicates. It will generate the entire result when open, and then return it a row at a time.

If passed aggregates it will do scalar or vector aggregate processing. A list of aggregator information is passed off of the PreparedStatement's savedObjects. Aggregation and SELECT DISTINCT cannot be processed in the same sort.

Specified by:
getSortResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be filtered by this operation.
distinct - true if distinct SELECT list
isInSortedOrder - true if the source result set is in sorted order
orderItem - entry in preparedStatement's savedObjects for order
activation - the activation for this result set, against which the sort-unique is performed.
rowAllocator - a reference to a method in the activation that generates rows of the right size and shape for the source
maxRowSize - the size of the row that is allocated by rowAllocator. size should be the maximum size of the sum of all the datatypes. user type are necessarily approximated
resultSetNumber - The resultSetNumber for the ResultSet
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the distinct operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getSortResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, boolean, boolean, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, int, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getScalarAggregateResultSet

public NoPutResultSet getScalarAggregateResultSet(NoPutResultSet source,
                                                  boolean isInSortedOrder,
                                                  int aggregateItem,
                                                  int orderItem,
                                                  Activation activation,
                                                  GeneratedMethod rowAllocator,
                                                  int maxRowSize,
                                                  int resultSetNumber,
                                                  boolean singleInputRow,
                                                  double optimizerEstimatedRowCount,
                                                  double optimizerEstimatedCost,
                                                  GeneratedMethod closeCleanup)
                                           throws StandardException
Description copied from interface: ResultSetFactory
A ScalarAggregateResultSet computes non-distinct scalar aggregates. It will compute the aggregates when open.

Specified by:
getScalarAggregateResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be filtered by this operation.
isInSortedOrder - true if the source result set is in sorted order
aggregateItem - entry in preparedStatement's savedObjects for aggregates
orderItem - Ignored to allow same signature as getDistinctScalarAggregateResultSet
activation - the activation for this result set, against which the sort-unique is performed.
rowAllocator - a reference to a method in the activation that generates rows of the right size and shape for the source
maxRowSize - Ignored to allow same signature as getDistinctScalarAggregateResultSet
resultSetNumber - The resultSetNumber for the ResultSet
singleInputRow - Whether we know we have a single input row or not
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the scalar aggregation operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getScalarAggregateResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, boolean, int, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, int, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getDistinctScalarAggregateResultSet

public NoPutResultSet getDistinctScalarAggregateResultSet(NoPutResultSet source,
                                                          boolean isInSortedOrder,
                                                          int aggregateItem,
                                                          int orderItem,
                                                          Activation activation,
                                                          GeneratedMethod rowAllocator,
                                                          int maxRowSize,
                                                          int resultSetNumber,
                                                          boolean singleInputRow,
                                                          double optimizerEstimatedRowCount,
                                                          double optimizerEstimatedCost,
                                                          GeneratedMethod closeCleanup)
                                                   throws StandardException
Description copied from interface: ResultSetFactory
A DistinctScalarAggregateResultSet computes scalar aggregates when at least one of them is a distinct aggregate. It will compute the aggregates when open.

Specified by:
getDistinctScalarAggregateResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be filtered by this operation.
isInSortedOrder - true if the source result set is in sorted order
aggregateItem - entry in preparedStatement's savedObjects for aggregates
activation - the activation for this result set, against which the sort-unique is performed.
rowAllocator - a reference to a method in the activation that generates rows of the right size and shape for the source
maxRowSize - the size of the row that is allocated by rowAllocator. size should be the maximum size of the sum of all the datatypes. user type are necessarily approximated
resultSetNumber - The resultSetNumber for the ResultSet
singleInputRow - Whether we know we have a single input row or not
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the scalar aggregation operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getDistinctScalarAggregateResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, boolean, int, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, int, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getGroupedAggregateResultSet

public NoPutResultSet getGroupedAggregateResultSet(NoPutResultSet source,
                                                   boolean isInSortedOrder,
                                                   int aggregateItem,
                                                   int orderItem,
                                                   Activation activation,
                                                   GeneratedMethod rowAllocator,
                                                   int maxRowSize,
                                                   int resultSetNumber,
                                                   double optimizerEstimatedRowCount,
                                                   double optimizerEstimatedCost,
                                                   GeneratedMethod closeCleanup)
                                            throws StandardException
Description copied from interface: ResultSetFactory
A GroupedAggregateResultSet computes non-distinct grouped aggregates. It will compute the aggregates when open.

Specified by:
getGroupedAggregateResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be filtered by this operation.
isInSortedOrder - true if the source result set is in sorted order
aggregateItem - entry in preparedStatement's savedObjects for aggregates
orderItem - Ignored to allow same signature as getDistinctScalarAggregateResultSet
activation - the activation for this result set, against which the sort-unique is performed.
rowAllocator - a reference to a method in the activation that generates rows of the right size and shape for the source
maxRowSize - Ignored to allow same signature as getDistinctScalarAggregateResultSet
resultSetNumber - The resultSetNumber for the ResultSet
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the scalar aggregation operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getGroupedAggregateResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, boolean, int, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, int, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getDistinctGroupedAggregateResultSet

public NoPutResultSet getDistinctGroupedAggregateResultSet(NoPutResultSet source,
                                                           boolean isInSortedOrder,
                                                           int aggregateItem,
                                                           int orderItem,
                                                           Activation activation,
                                                           GeneratedMethod rowAllocator,
                                                           int maxRowSize,
                                                           int resultSetNumber,
                                                           double optimizerEstimatedRowCount,
                                                           double optimizerEstimatedCost,
                                                           GeneratedMethod closeCleanup)
                                                    throws StandardException
Description copied from interface: ResultSetFactory
A DistinctGroupedAggregateResultSet computes scalar aggregates when at least one of them is a distinct aggregate. It will compute the aggregates when open.

Specified by:
getDistinctGroupedAggregateResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be filtered by this operation.
isInSortedOrder - true if the source result set is in sorted order
aggregateItem - entry in preparedStatement's savedObjects for aggregates
activation - the activation for this result set, against which the sort-unique is performed.
rowAllocator - a reference to a method in the activation that generates rows of the right size and shape for the source
maxRowSize - the size of the row that is allocated by rowAllocator. size should be the maximum size of the sum of all the datatypes. user type are necessarily approximated
resultSetNumber - The resultSetNumber for the ResultSet
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the scalar aggregation operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getDistinctGroupedAggregateResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, boolean, int, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, int, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getAnyResultSet

public NoPutResultSet getAnyResultSet(NoPutResultSet source,
                                      Activation activation,
                                      GeneratedMethod emptyRowFun,
                                      int resultSetNumber,
                                      int subqueryNumber,
                                      int pointOfAttachment,
                                      double optimizerEstimatedRowCount,
                                      double optimizerEstimatedCost)
                               throws StandardException
Description copied from interface: ResultSetFactory
An any result set iterates over its source, returning a row with all columns set to nulls if the source returns no rows.

Specified by:
getAnyResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be filtered by this operation.
activation - the activation for this result set, against whcih the restriction and projection are performed and to which current rows must be assigned for the projection and restriction to be performed.
emptyRowFun - a reference to a method in the activation that is called if the source returns no rows
resultSetNumber - The resultSetNumber for the ResultSet
subqueryNumber - The subquery number for this subquery.
pointOfAttachment - The point of attachment for this subquery.
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
Returns:
the any operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getAnyResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, int, int, double, double)

getOnceResultSet

public NoPutResultSet getOnceResultSet(NoPutResultSet source,
                                       Activation activation,
                                       GeneratedMethod emptyRowFun,
                                       int cardinalityCheck,
                                       int resultSetNumber,
                                       int subqueryNumber,
                                       int pointOfAttachment,
                                       double optimizerEstimatedRowCount,
                                       double optimizerEstimatedCost)
                                throws StandardException
Description copied from interface: ResultSetFactory
A once result set iterates over its source, raising an error if the source returns > 1 row and returning a row with all columns set to nulls if the source returns no rows.

Specified by:
getOnceResultSet in interface ResultSetFactory
Parameters:
source - the result set from which to take rows to be filtered by this operation.
activation - the activation for this result set, against whcih the restriction and projection are performed and to which current rows must be assigned for the projection and restriction to be performed.
emptyRowFun - a reference to a method in the activation that is called if the source returns no rows
cardinalityCheck - The type of cardinality check, if any that is required
resultSetNumber - The resultSetNumber for the ResultSet
subqueryNumber - The subquery number for this subquery.
pointOfAttachment - The point of attachment for this subquery.
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
Returns:
the once operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getOnceResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, int, int, int, double, double)

getRowResultSet

public NoPutResultSet getRowResultSet(Activation activation,
                                      GeneratedMethod row,
                                      boolean canCacheRow,
                                      int resultSetNumber,
                                      double optimizerEstimatedRowCount,
                                      double optimizerEstimatedCost,
                                      GeneratedMethod closeCleanup)
Description copied from interface: ResultSetFactory
A row result set forms a result set on a single, known row value. It is used to turn constant rows into result sets for use in the result set paradigm. The row can be constructed when it is requested from the result set.

Specified by:
getRowResultSet in interface ResultSetFactory
Parameters:
activation - the activation for this result set, against which the row operation is performed to create the result set.
row - a reference to a method in the activation that creates the expected row. ExecRow row() throws StandardException;
canCacheRow - True if execution can cache the input row after it has gotten it. If the input row is constructed soley of constants or parameters, it is ok to cache this row rather than recreating it each time it is requested.
resultSetNumber - The resultSetNumber for the ResultSet
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the row as a result set.
See Also:
ResultSetFactory.getRowResultSet(org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, boolean, int, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getVTIResultSet

public NoPutResultSet getVTIResultSet(Activation activation,
                                      GeneratedMethod row,
                                      int resultSetNumber,
                                      GeneratedMethod constructor,
                                      java.lang.String javaClassName,
                                      Qualifier[][] pushedQualifiers,
                                      int erdNumber,
                                      boolean version2,
                                      boolean reuseablePs,
                                      int ctcNumber,
                                      boolean isTarget,
                                      int scanIsolationLevel,
                                      double optimizerEstimatedRowCount,
                                      double optimizerEstimatedCost,
                                      GeneratedMethod closeCleanup)
                               throws StandardException
Description copied from interface: ResultSetFactory
A VTI result set wraps a user supplied result set.

Specified by:
getVTIResultSet in interface ResultSetFactory
Parameters:
activation - the activation for this result set, against which the row operation is performed to create the result set.
row - a reference to a method in the activation that creates the expected row. ExecRow row() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
constructor - The GeneratedMethod for the user's constructor
javaClassName - The java class name for the VTI
erdNumber - int for referenced column BitSet (so it can be turned back into an object)
version2 - Whether or not VTI is a version 2 VTI.
isTarget - Whether or not VTI is a target VTI.
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the row as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getVTIResultSet(org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, java.lang.String, org.apache.derby.iapi.store.access.Qualifier[][], int, boolean, boolean, int, boolean, int, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getHashScanResultSet

public NoPutResultSet getHashScanResultSet(long conglomId,
                                           int scociItem,
                                           Activation activation,
                                           GeneratedMethod resultRowAllocator,
                                           int resultSetNumber,
                                           GeneratedMethod startKeyGetter,
                                           int startSearchOperator,
                                           GeneratedMethod stopKeyGetter,
                                           int stopSearchOperator,
                                           boolean sameStartStopPosition,
                                           Qualifier[][] scanQualifiers,
                                           Qualifier[][] nextQualifiers,
                                           int initialCapacity,
                                           float loadFactor,
                                           int maxCapacity,
                                           int hashKeyColumn,
                                           java.lang.String tableName,
                                           java.lang.String indexName,
                                           boolean isConstraint,
                                           boolean forUpdate,
                                           int colRefItem,
                                           int indexColItem,
                                           int lockMode,
                                           boolean tableLocked,
                                           int isolationLevel,
                                           double optimizerEstimatedRowCount,
                                           double optimizerEstimatedCost,
                                           GeneratedMethod closeCleanup)
                                    throws StandardException
a hash scan generator, for ease of use at present.

Specified by:
getHashScanResultSet in interface ResultSetFactory
Parameters:
conglomId - the conglomerate of the table to be scanned.
scociItem - The saved item for the static conglomerate info.
activation - the activation for this result set, which provides the context for the row allocation operation.
resultRowAllocator - a reference to a method in the activation that creates a holder for the rows from the scan. ExecRow rowAllocator() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
startKeyGetter - a reference to a method in the activation that gets the start key indexable row for the scan. Null means there is no start key. ExecIndexRow startKeyGetter() throws StandardException;
startSearchOperator - The start search operator for opening the scan
stopKeyGetter - a reference to a method in the activation that gets the stop key indexable row for the scan. Null means there is no stop key. ExecIndexRow stopKeyGetter() throws StandardException;
stopSearchOperator - The stop search operator for opening the scan
sameStartStopPosition - Re-use the startKeyGetter for the stopKeyGetter (Exact match search.)
scanQualifiers - the array of Qualifiers for the scan. Null or an array length of zero means there are no qualifiers.
nextQualifiers - the array of Qualifiers for the look up into the hash table.
initialCapacity - The initialCapacity for the HashTable.
loadFactor - The loadFactor for the HashTable.
maxCapacity - The maximum size for the HashTable.
hashKeyColumn - The 0-based column # for the hash key.
tableName - The full name of the table
indexName - The name of the index, if one used to access table.
isConstraint - If index, if used, is a backing index for a constraint.
forUpdate - True means open for update
colRefItem - An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
lockMode - The lock granularity to use (see TransactionController in access)
tableLocked - Whether or not the table is marked as using table locking (in sys.systables)
isolationLevel - Isolation level (specified or not) to use on scans
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the table scan operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getHashScanResultSet(long, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.store.access.Qualifier[][], int, float, int, int, java.lang.String, java.lang.String, boolean, boolean, int, int, int, boolean, int, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getDistinctScanResultSet

public NoPutResultSet getDistinctScanResultSet(long conglomId,
                                               int scociItem,
                                               Activation activation,
                                               GeneratedMethod resultRowAllocator,
                                               int resultSetNumber,
                                               int hashKeyColumn,
                                               java.lang.String tableName,
                                               java.lang.String indexName,
                                               boolean isConstraint,
                                               int colRefItem,
                                               int lockMode,
                                               boolean tableLocked,
                                               int isolationLevel,
                                               double optimizerEstimatedRowCount,
                                               double optimizerEstimatedCost,
                                               GeneratedMethod closeCleanup)
                                        throws StandardException
a distinct scan generator, for ease of use at present.

Specified by:
getDistinctScanResultSet in interface ResultSetFactory
Parameters:
conglomId - the conglomerate of the table to be scanned.
scociItem - The saved item for the static conglomerate info.
activation - the activation for this result set, which provides the context for the row allocation operation.
resultRowAllocator - a reference to a method in the activation that creates a holder for the rows from the scan. ExecRow rowAllocator() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
hashKeyColumn - The 0-based column # for the hash key.
tableName - The full name of the table
indexName - The name of the index, if one used to access table.
isConstraint - If index, if used, is a backing index for a constraint.
colRefItem - An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
lockMode - The lock granularity to use (see TransactionController in access)
tableLocked - Whether or not the table is marked as using table locking (in sys.systables)
isolationLevel - Isolation level (specified or not) to use on scans
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the table scan operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getHashScanResultSet(long, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.store.access.Qualifier[][], int, float, int, int, java.lang.String, java.lang.String, boolean, boolean, int, int, int, boolean, int, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getTableScanResultSet

public NoPutResultSet getTableScanResultSet(long conglomId,
                                            int scociItem,
                                            Activation activation,
                                            GeneratedMethod resultRowAllocator,
                                            int resultSetNumber,
                                            GeneratedMethod startKeyGetter,
                                            int startSearchOperator,
                                            GeneratedMethod stopKeyGetter,
                                            int stopSearchOperator,
                                            boolean sameStartStopPosition,
                                            Qualifier[][] qualifiers,
                                            java.lang.String tableName,
                                            java.lang.String indexName,
                                            boolean isConstraint,
                                            boolean forUpdate,
                                            int colRefItem,
                                            int indexColItem,
                                            int lockMode,
                                            boolean tableLocked,
                                            int isolationLevel,
                                            boolean oneRowScan,
                                            double optimizerEstimatedRowCount,
                                            double optimizerEstimatedCost,
                                            GeneratedMethod closeCleanup)
                                     throws StandardException
a minimal table scan generator, for ease of use at present.

Specified by:
getTableScanResultSet in interface ResultSetFactory
Parameters:
conglomId - the conglomerate of the table to be scanned.
scociItem - The saved item for the static conglomerate info.
activation - the activation for this result set, which provides the context for the row allocation operation.
resultRowAllocator - a reference to a method in the activation that creates a holder for the result row of the scan. May be a partial row. ExecRow rowAllocator() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
startKeyGetter - a reference to a method in the activation that gets the start key indexable row for the scan. Null means there is no start key. ExecIndexRow startKeyGetter() throws StandardException;
startSearchOperator - The start search operator for opening the scan
stopKeyGetter - a reference to a method in the activation that gets the stop key indexable row for the scan. Null means there is no stop key. ExecIndexRow stopKeyGetter() throws StandardException;
stopSearchOperator - The stop search operator for opening the scan
sameStartStopPosition - Re-use the startKeyGetter for the stopKeyGetter (Exact match search.)
qualifiers - the array of Qualifiers for the scan. Null or an array length of zero means there are no qualifiers.
tableName - The full name of the table
indexName - The name of the index, if one used to access table.
isConstraint - If index, if used, is a backing index for a constraint.
forUpdate - True means open for update
colRefItem - An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
lockMode - The lock granularity to use (see TransactionController in access)
tableLocked - Whether or not the table is marked as using table locking (in sys.systables)
isolationLevel - Isolation level (specified or not) to use on scans
oneRowScan - Whether or not this is a 1 row scan.
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the table scan operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getTableScanResultSet(long, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, org.apache.derby.iapi.store.access.Qualifier[][], java.lang.String, java.lang.String, boolean, boolean, int, int, int, boolean, int, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getBulkTableScanResultSet

public NoPutResultSet getBulkTableScanResultSet(long conglomId,
                                                int scociItem,
                                                Activation activation,
                                                GeneratedMethod resultRowAllocator,
                                                int resultSetNumber,
                                                GeneratedMethod startKeyGetter,
                                                int startSearchOperator,
                                                GeneratedMethod stopKeyGetter,
                                                int stopSearchOperator,
                                                boolean sameStartStopPosition,
                                                Qualifier[][] qualifiers,
                                                java.lang.String tableName,
                                                java.lang.String indexName,
                                                boolean isConstraint,
                                                boolean forUpdate,
                                                int colRefItem,
                                                int indexColItem,
                                                int lockMode,
                                                boolean tableLocked,
                                                int isolationLevel,
                                                int rowsPerRead,
                                                boolean oneRowScan,
                                                double optimizerEstimatedRowCount,
                                                double optimizerEstimatedCost,
                                                GeneratedMethod closeCleanup)
                                         throws StandardException
Table/Index scan where rows are read in bulk

Specified by:
getBulkTableScanResultSet in interface ResultSetFactory
Parameters:
conglomId - the conglomerate of the table to be scanned.
scociItem - The saved item for the static conglomerate info.
activation - the activation for this result set, which provides the context for the row allocation operation.
resultRowAllocator - a reference to a method in the activation that creates a holder for the result row of the scan. May be a partial row. ExecRow rowAllocator() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
startKeyGetter - a reference to a method in the activation that gets the start key indexable row for the scan. Null means there is no start key. ExecIndexRow startKeyGetter() throws StandardException;
startSearchOperator - The start search operator for opening the scan
stopKeyGetter - a reference to a method in the activation that gets the stop key indexable row for the scan. Null means there is no stop key. ExecIndexRow stopKeyGetter() throws StandardException;
stopSearchOperator - The stop search operator for opening the scan
sameStartStopPosition - Re-use the startKeyGetter for the stopKeyGetter (Exact match search.)
qualifiers - the array of Qualifiers for the scan. Null or an array length of zero means there are no qualifiers.
tableName - The full name of the table
indexName - The name of the index, if one used to access table.
isConstraint - If index, if used, is a backing index for a constraint.
forUpdate - True means open for update
colRefItem - An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
lockMode - The lock granularity to use (see TransactionController in access)
tableLocked - Whether or not the table is marked as using table locking (in sys.systables)
isolationLevel - Isolation level (specified or not) to use on scans
rowsPerRead - The number of rows to read per fetch.
oneRowScan - Whether or not this is a 1 row scan.
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the table scan operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getBulkTableScanResultSet(long, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, org.apache.derby.iapi.store.access.Qualifier[][], java.lang.String, java.lang.String, boolean, boolean, int, int, int, boolean, int, int, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getIndexRowToBaseRowResultSet

public NoPutResultSet getIndexRowToBaseRowResultSet(long conglomId,
                                                    int scociItem,
                                                    Activation a,
                                                    NoPutResultSet source,
                                                    GeneratedMethod resultRowAllocator,
                                                    int resultSetNumber,
                                                    java.lang.String indexName,
                                                    int heapColRefItem,
                                                    int indexColRefItem,
                                                    int indexColMapItem,
                                                    GeneratedMethod restriction,
                                                    boolean forUpdate,
                                                    double optimizerEstimatedRowCount,
                                                    double optimizerEstimatedCost,
                                                    GeneratedMethod closeCleanup)
                                             throws StandardException
Description copied from interface: ResultSetFactory
An index row to base row result set gets an index row from its source and uses the RowLocation in its last column to get the row from the base conglomerate.

Specified by:
getIndexRowToBaseRowResultSet in interface ResultSetFactory
Parameters:
conglomId - Conglomerate # for the heap.
source - the source result set, which is expected to provide rows from an index conglomerate
resultRowAllocator - a reference to a method in the activation that creates a holder for the rows from the scan. ExecRow rowAllocator() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
indexName - The name of the index.
heapColRefItem - A saved item for a bitImpl of columns that are referenced in the underlying heap. -1 if no item.
indexColRefItem - A saved item for a bitImpl of columns that are referenced in the underlying index. -1 if no item.
indexColMapItem - A saved item for a ReferencedColumnsDescriptorImpl which tell which columms are coming from the index.
restriction - The restriction, if any, to be applied to the base row
forUpdate - True means to open for update
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the index row to base row operation as a result set.
Throws:
StandardException - Thrown on error
See Also:
ResultSetFactory.getIndexRowToBaseRowResultSet(long, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.services.loader.GeneratedMethod, int, java.lang.String, int, int, int, org.apache.derby.iapi.services.loader.GeneratedMethod, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getNestedLoopJoinResultSet

public NoPutResultSet getNestedLoopJoinResultSet(NoPutResultSet leftResultSet,
                                                 int leftNumCols,
                                                 NoPutResultSet rightResultSet,
                                                 int rightNumCols,
                                                 Activation activation,
                                                 GeneratedMethod joinClause,
                                                 int resultSetNumber,
                                                 boolean oneRowRightSide,
                                                 boolean notExistsRightSide,
                                                 double optimizerEstimatedRowCount,
                                                 double optimizerEstimatedCost,
                                                 GeneratedMethod closeCleanup)
                                          throws StandardException
Description copied from interface: ResultSetFactory
A nested loop left outer join result set forms a result set on top of 2 other result sets. The rows can be constructed as they are requested from the result set.

This form of the nested loop join operation is simple, and is to be used when there are no join predicates to be passed down to the join to limit its scope on the right ResultSet.

Specified by:
getNestedLoopJoinResultSet in interface ResultSetFactory
Parameters:
leftResultSet - Outer ResultSet for join.
leftNumCols - Number of columns in the leftResultSet
rightResultSet - Inner ResultSet for join.
rightNumCols - Number of columns in the rightResultSet
activation - the activation for this result set, which provides the context for the row allocation operation.
joinClause - a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the joinClause is satisfied or not. The signature of this method is Boolean joinClause() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
oneRowRightSide - boolean, whether or not the right side returns a single row. (No need to do 2nd next() if it does.)
notExistsRightSide - boolean, whether or not the right side resides a NOT EXISTS base table
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the nested loop join operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getNestedLoopJoinResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, int, org.apache.derby.iapi.sql.execute.NoPutResultSet, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getHashJoinResultSet

public NoPutResultSet getHashJoinResultSet(NoPutResultSet leftResultSet,
                                           int leftNumCols,
                                           NoPutResultSet rightResultSet,
                                           int rightNumCols,
                                           Activation activation,
                                           GeneratedMethod joinClause,
                                           int resultSetNumber,
                                           boolean oneRowRightSide,
                                           boolean notExistsRightSide,
                                           double optimizerEstimatedRowCount,
                                           double optimizerEstimatedCost,
                                           GeneratedMethod closeCleanup)
                                    throws StandardException
Description copied from interface: ResultSetFactory
A hash join.

Specified by:
getHashJoinResultSet in interface ResultSetFactory
Parameters:
leftResultSet - Outer ResultSet for join.
leftNumCols - Number of columns in the leftResultSet
rightResultSet - Inner ResultSet for join.
rightNumCols - Number of columns in the rightResultSet
activation - the activation for this result set, which provides the context for the row allocation operation.
joinClause - a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the joinClause is satisfied or not. The signature of this method is Boolean joinClause() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
oneRowRightSide - boolean, whether or not the right side returns a single row. (No need to do 2nd next() if it does.)
notExistsRightSide - boolean, whether or not the right side resides a NOT EXISTS base table
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the nested loop join operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getHashJoinResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, int, org.apache.derby.iapi.sql.execute.NoPutResultSet, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getNestedLoopLeftOuterJoinResultSet

public NoPutResultSet getNestedLoopLeftOuterJoinResultSet(NoPutResultSet leftResultSet,
                                                          int leftNumCols,
                                                          NoPutResultSet rightResultSet,
                                                          int rightNumCols,
                                                          Activation activation,
                                                          GeneratedMethod joinClause,
                                                          int resultSetNumber,
                                                          GeneratedMethod emptyRowFun,
                                                          boolean wasRightOuterJoin,
                                                          boolean oneRowRightSide,
                                                          boolean notExistsRightSide,
                                                          double optimizerEstimatedRowCount,
                                                          double optimizerEstimatedCost,
                                                          GeneratedMethod closeCleanup)
                                                   throws StandardException
Description copied from interface: ResultSetFactory
A nested loop join result set forms a result set on top of 2 other result sets. The rows can be constructed as they are requested from the result set.

This form of the nested loop join operation is simple, and is to be used when there are no join predicates to be passed down to the join to limit its scope on the right ResultSet.

Specified by:
getNestedLoopLeftOuterJoinResultSet in interface ResultSetFactory
Parameters:
leftResultSet - Outer ResultSet for join.
leftNumCols - Number of columns in the leftResultSet
rightResultSet - Inner ResultSet for join.
rightNumCols - Number of columns in the rightResultSet
activation - the activation for this result set, which provides the context for the row allocation operation.
joinClause - a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the joinClause is satisfied or not. The signature of this method is Boolean joinClause() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
emptyRowFun - a reference to a method in the activation that is called if the right child returns no rows
wasRightOuterJoin - Whether or not this was originally a right outer join
oneRowRightSide - boolean, whether or not the right side returns a single row. (No need to do 2nd next() if it does.)
notExistsRightSide - boolean, whether or not the right side resides a NOT EXISTS base table
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the nested loop join operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getNestedLoopLeftOuterJoinResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, int, org.apache.derby.iapi.sql.execute.NoPutResultSet, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, boolean, boolean, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getHashLeftOuterJoinResultSet

public NoPutResultSet getHashLeftOuterJoinResultSet(NoPutResultSet leftResultSet,
                                                    int leftNumCols,
                                                    NoPutResultSet rightResultSet,
                                                    int rightNumCols,
                                                    Activation activation,
                                                    GeneratedMethod joinClause,
                                                    int resultSetNumber,
                                                    GeneratedMethod emptyRowFun,
                                                    boolean wasRightOuterJoin,
                                                    boolean oneRowRightSide,
                                                    boolean notExistsRightSide,
                                                    double optimizerEstimatedRowCount,
                                                    double optimizerEstimatedCost,
                                                    GeneratedMethod closeCleanup)
                                             throws StandardException
Description copied from interface: ResultSetFactory
A left outer join using a hash join.

Specified by:
getHashLeftOuterJoinResultSet in interface ResultSetFactory
Parameters:
leftResultSet - Outer ResultSet for join.
leftNumCols - Number of columns in the leftResultSet
rightResultSet - Inner ResultSet for join.
rightNumCols - Number of columns in the rightResultSet
activation - the activation for this result set, which provides the context for the row allocation operation.
joinClause - a reference to a method in the activation that is applied to the activation's "current row" field to determine whether the joinClause is satisfied or not. The signature of this method is Boolean joinClause() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
emptyRowFun - a reference to a method in the activation that is called if the right child returns no rows
wasRightOuterJoin - Whether or not this was originally a right outer join
oneRowRightSide - boolean, whether or not the right side returns a single row. (No need to do 2nd next() if it does.)
notExistsRightSide - boolean, whether or not the right side resides a NOT EXISTS base table
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the nested loop join operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getHashLeftOuterJoinResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, int, org.apache.derby.iapi.sql.execute.NoPutResultSet, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, boolean, boolean, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getSetTransactionResultSet

public ResultSet getSetTransactionResultSet(Activation activation)
                                     throws StandardException
Specified by:
getSetTransactionResultSet in interface ResultSetFactory
Parameters:
activation - the activation for this result set
Returns:
ResultSet A wrapper result set to run the Execution-time logic.
Throws:
StandardException - thrown when unable to create the result set
See Also:
ResultSetFactory.getSetTransactionResultSet(org.apache.derby.iapi.sql.Activation)

getMaterializedResultSet

public NoPutResultSet getMaterializedResultSet(NoPutResultSet source,
                                               Activation activation,
                                               int resultSetNumber,
                                               double optimizerEstimatedRowCount,
                                               double optimizerEstimatedCost,
                                               GeneratedMethod closeCleanup)
                                        throws StandardException
Description copied from interface: ResultSetFactory
A ResultSet which materializes the underlying ResultSet tree into a temp table on the 1st open. All subsequent "scans" of this ResultSet will return results from the temp table.

Specified by:
getMaterializedResultSet in interface ResultSetFactory
Parameters:
source - the result set input to this result set.
activation - the activation for this result set, which provides the context for normalization.
resultSetNumber - The resultSetNumber for the ResultSet
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the materialization operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getMaterializedResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation, int, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getScrollInsensitiveResultSet

public NoPutResultSet getScrollInsensitiveResultSet(NoPutResultSet source,
                                                    Activation activation,
                                                    int resultSetNumber,
                                                    int sourceRowWidth,
                                                    boolean scrollable,
                                                    double optimizerEstimatedRowCount,
                                                    double optimizerEstimatedCost,
                                                    GeneratedMethod closeCleanup)
                                             throws StandardException
Description copied from interface: ResultSetFactory
A ResultSet which provides the insensitive scrolling functionality for the underlying result set by materializing the underlying ResultSet tree into a hash table while scrolling forward.

Specified by:
getScrollInsensitiveResultSet in interface ResultSetFactory
Parameters:
source - the result set input to this result set.
activation - the activation for this result set, which provides the context for normalization.
resultSetNumber - The resultSetNumber for the ResultSet
sourceRowWidth - The # of columns in the source row.
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the materialization operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getScrollInsensitiveResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation, int, int, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getNormalizeResultSet

public NoPutResultSet getNormalizeResultSet(NoPutResultSet source,
                                            Activation activation,
                                            int resultSetNumber,
                                            int erdNumber,
                                            double optimizerEstimatedRowCount,
                                            double optimizerEstimatedCost,
                                            boolean forUpdate,
                                            GeneratedMethod closeCleanup)
                                     throws StandardException
Description copied from interface: ResultSetFactory
REMIND: needs more description...

Specified by:
getNormalizeResultSet in interface ResultSetFactory
Parameters:
source - the result set input to this result set.
activation - the activation for this result set, which provides the context for normalization.
resultSetNumber - The resultSetNumber for the ResultSet
erdNumber - int for ResultDescription (so it can be turned back into an object)
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the normalization operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getNormalizeResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation, int, int, double, double, boolean, org.apache.derby.iapi.services.loader.GeneratedMethod)

getCurrentOfResultSet

public NoPutResultSet getCurrentOfResultSet(java.lang.String cursorName,
                                            Activation activation,
                                            int resultSetNumber,
                                            java.lang.String psName)
Description copied from interface: ResultSetFactory
A current of result set forms a result set on the current row of an open cursor. It is used to perform positioned operations such as positioned update and delete, using the result set paradigm.

Specified by:
getCurrentOfResultSet in interface ResultSetFactory
Parameters:
cursorName - the name of the cursor providing the row.
activation - the activation for this result set, used to provide information about the result set.
resultSetNumber - The resultSetNumber for the ResultSet
See Also:
ResultSetFactory.getCurrentOfResultSet(java.lang.String, org.apache.derby.iapi.sql.Activation, int, java.lang.String)

getDDLResultSet

public ResultSet getDDLResultSet(Activation activation)
                          throws StandardException
Description copied from interface: ResultSetFactory
Generic DDL result set creation.

Specified by:
getDDLResultSet in interface ResultSetFactory
Parameters:
activation - the activation for this result set
Returns:
ResultSet A wrapper result set to run the Execution-time logic.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getDDLResultSet(org.apache.derby.iapi.sql.Activation)

getMiscResultSet

public ResultSet getMiscResultSet(Activation activation)
                           throws StandardException
Description copied from interface: ResultSetFactory
Generic Misc result set creation.

Specified by:
getMiscResultSet in interface ResultSetFactory
Parameters:
activation - the activation for this result set
Returns:
ResultSet A wrapper result set to run the Execution-time logic.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getMiscResultSet(org.apache.derby.iapi.sql.Activation)

getUnionResultSet

public NoPutResultSet getUnionResultSet(NoPutResultSet leftResultSet,
                                        NoPutResultSet rightResultSet,
                                        Activation activation,
                                        int resultSetNumber,
                                        double optimizerEstimatedRowCount,
                                        double optimizerEstimatedCost,
                                        GeneratedMethod closeCleanup)
                                 throws StandardException
a minimal union scan generator, for ease of use at present.

Specified by:
getUnionResultSet in interface ResultSetFactory
Parameters:
leftResultSet - The first ResultSet whose rows go into the union
rightResultSet - The second ResultSet whose rows go into the union
activation - the activation for this result set, which provides the context for normalization.
resultSetNumber - The resultSetNumber for the ResultSet
closeCleanup - any cleanup the activation needs to do on close.
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
Returns:
A ResultSet from which the caller can get the union of the two source ResultSets.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getUnionResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.execute.NoPutResultSet, org.apache.derby.iapi.sql.Activation, int, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getLastIndexKeyResultSet

public NoPutResultSet getLastIndexKeyResultSet(Activation activation,
                                               int resultSetNumber,
                                               GeneratedMethod resultRowAllocator,
                                               long conglomId,
                                               java.lang.String tableName,
                                               java.lang.String indexName,
                                               int colRefItem,
                                               int lockMode,
                                               boolean tableLocked,
                                               int isolationLevel,
                                               double optimizerEstimatedRowCount,
                                               double optimizerEstimatedCost,
                                               GeneratedMethod closeCleanup)
                                        throws StandardException
A last index key sresult set returns the last row from the index in question. It is used as an ajunct to max().

Specified by:
getLastIndexKeyResultSet in interface ResultSetFactory
Parameters:
activation - the activation for this result set, which provides the context for the row allocation operation.
resultSetNumber - The resultSetNumber for the ResultSet
resultRowAllocator - a reference to a method in the activation that creates a holder for the result row of the scan. May be a partial row. ExecRow rowAllocator() throws StandardException;
conglomId - the conglomerate of the table to be scanned.
tableName - The full name of the table
indexName - The name of the index, if one used to access table.
colRefItem - An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
lockMode - The lock granularity to use (see TransactionController in access)
tableLocked - Whether or not the table is marked as using table locking (in sys.systables)
isolationLevel - Isolation level (specified or not) to use on scans
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
Returns:
the scan operation as a result set.
Throws:
StandardException - thrown when unable to create the result set

getRaDependentTableScanResultSet

public NoPutResultSet getRaDependentTableScanResultSet(long conglomId,
                                                       int scociItem,
                                                       Activation activation,
                                                       GeneratedMethod resultRowAllocator,
                                                       int resultSetNumber,
                                                       GeneratedMethod startKeyGetter,
                                                       int startSearchOperator,
                                                       GeneratedMethod stopKeyGetter,
                                                       int stopSearchOperator,
                                                       boolean sameStartStopPosition,
                                                       Qualifier[][] qualifiers,
                                                       java.lang.String tableName,
                                                       java.lang.String indexName,
                                                       boolean isConstraint,
                                                       boolean forUpdate,
                                                       int colRefItem,
                                                       int indexColItem,
                                                       int lockMode,
                                                       boolean tableLocked,
                                                       int isolationLevel,
                                                       boolean oneRowScan,
                                                       double optimizerEstimatedRowCount,
                                                       double optimizerEstimatedCost,
                                                       GeneratedMethod closeCleanup,
                                                       java.lang.String parentResultSetId,
                                                       long fkIndexConglomId,
                                                       int fkColArrayItem,
                                                       int rltItem)
                                                throws StandardException
a referential action dependent table scan generator.

Specified by:
getRaDependentTableScanResultSet in interface ResultSetFactory
Parameters:
conglomId - the conglomerate of the table to be scanned.
scociItem - The saved item for the static conglomerate info.
activation - the activation for this result set, which provides the context for the row allocation operation.
resultRowAllocator - a reference to a method in the activation that creates a holder for the result row of the scan. May be a partial row. ExecRow rowAllocator() throws StandardException;
resultSetNumber - The resultSetNumber for the ResultSet
startKeyGetter - a reference to a method in the activation that gets the start key indexable row for the scan. Null means there is no start key. ExecIndexRow startKeyGetter() throws StandardException;
startSearchOperator - The start search operator for opening the scan
stopKeyGetter - a reference to a method in the activation that gets the stop key indexable row for the scan. Null means there is no stop key. ExecIndexRow stopKeyGetter() throws StandardException;
stopSearchOperator - The stop search operator for opening the scan
sameStartStopPosition - Re-use the startKeyGetter for the stopKeyGetter (Exact match search.)
qualifiers - the array of Qualifiers for the scan. Null or an array length of zero means there are no qualifiers.
tableName - The full name of the table
indexName - The name of the index, if one used to access table.
isConstraint - If index, if used, is a backing index for a constraint.
forUpdate - True means open for update
colRefItem - An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
lockMode - The lock granularity to use (see TransactionController in access)
tableLocked - Whether or not the table is marked as using table locking (in sys.systables)
isolationLevel - Isolation level (specified or not) to use on scans
oneRowScan - Whether or not this is a 1 row scan.
optimizerEstimatedRowCount - Estimated total # of rows by optimizer
optimizerEstimatedCost - Estimated total cost by optimizer
closeCleanup - any cleanup the activation needs to do on close.
parentResultSetId - Id to access the materlized temporary result set from the refence stored in the activation.
fkIndexConglomId - foreign key index conglomerate id.
fkColArrayItem - saved column array object that matches the foreign key index columns and the resultset from the parent table.
rltItem - row location template
Returns:
the table scan operation as a result set.
Throws:
StandardException - thrown on error
See Also:
ResultSetFactory.getTableScanResultSet(long, int, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, org.apache.derby.iapi.store.access.Qualifier[][], java.lang.String, java.lang.String, boolean, boolean, int, int, int, boolean, int, boolean, double, double, org.apache.derby.iapi.services.loader.GeneratedMethod)

getAuthorizer

private static Authorizer getAuthorizer(Activation activation)


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.