Class GenericResultSetFactory

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

public class GenericResultSetFactory extends 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.

  • Field Summary

    Fields inherited from interface org.apache.derby.iapi.sql.execute.ResultSetFactory

    MODULE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getAnyResultSet(NoPutResultSet source, 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
     
    getBulkTableScanResultSet(Activation activation, long conglomId, int scociItem, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, int rowsPerRead, boolean disableForHoldable, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    Table/Index scan where rows are read in bulk
    A call statement result set simply reports that it completed.
    getCurrentOfResultSet(String cursorName, Activation activation, int resultSetNumber)
    A current of result set forms a result set on the current row of an open cursor.
    Generic DDL result set creation.
    getDeleteCascadeResultSet(NoPutResultSet source, int constantActionItem, ResultSet[] dependentResultSets, String resultSetId)
    A delete Cascade result set simply reports that it completed, and the number of rows deleted.
    getDeleteCascadeUpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, int constantActionItem, int rsdItem)
    An update result set simply reports that it completed, and the number of rows updated.
    A delete result set simply reports that it completed, and the number of rows deleted.
    A delete VTI result set simply reports that it completed, and the number of rows deleted.
    getDistinctGroupedAggregateResultSet(NoPutResultSet source, boolean isInSortedOrder, int aggregateItem, int orderItem, int rowAllocator, int maxRowSize, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, boolean isRollup)
    A DistinctGroupedAggregateResultSet computes scalar aggregates when at least one of them is a distinct aggregate.
    getDistinctScalarAggregateResultSet(NoPutResultSet source, boolean isInSortedOrder, int aggregateItem, int orderItem, int rowAllocator, int maxRowSize, int resultSetNumber, boolean singleInputRow, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    A DistinctScalarAggregateResultSet computes scalar aggregates when at least one of them is a distinct aggregate.
    getDistinctScanResultSet(Activation activation, long conglomId, int scociItem, int resultRowTemplate, int resultSetNumber, int hashKeyColumn, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    a distinct scan generator, for ease of use at present.
    getGroupedAggregateResultSet(NoPutResultSet source, boolean isInSortedOrder, int aggregateItem, int orderItem, int rowAllocator, int maxRowSize, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, boolean isRollup)
    A GroupedAggregateResultSet computes non-distinct grouped aggregates.
    getHashJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, GeneratedMethod joinClause, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String userSuppliedOptimizerOverrides)
    A hash join.
    getHashLeftOuterJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, GeneratedMethod joinClause, int resultSetNumber, GeneratedMethod emptyRowFun, boolean wasRightOuterJoin, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String userSuppliedOptimizerOverrides)
    A left outer join using a hash join.
    getHashScanResultSet(Activation activation, long conglomId, int scociItem, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] scanQualifiers, Qualifier[][] nextQualifiers, int initialCapacity, float loadFactor, int maxCapacity, int hashKeyColumn, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    a hash scan generator, for ease of use at present.
    getHashTableResultSet(NoPutResultSet source, 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)
    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.
    getIndexRowToBaseRowResultSet(long conglomId, int scociItem, NoPutResultSet source, int resultRowAllocator, int resultSetNumber, String indexName, int heapColRefItem, int allColRefItem, int heapOnlyColRefItem, int indexColMapItem, GeneratedMethod restriction, boolean forUpdate, double optimizerEstimatedRowCount, double optimizerEstimatedCost, int baseColumnCount)
    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.
    getInsertResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, int fullTemplate, String schemaName, String tableName)
    An insert result set simply reports that it completed, and the number of rows inserted.
    An insert VTI result set simply reports that it completed, and the number of rows inserted.
    getLastIndexKeyResultSet(Activation activation, int resultSetNumber, int resultRowTemplate, long conglomId, String tableName, String userSuppliedOptimizerOverrides, String indexName, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    A last index key sresult set returns the last row from the index in question.
    getMaterializedResultSet(NoPutResultSet source, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    A ResultSet which materializes the underlying ResultSet tree into a temp table on the 1st open.
    A MERGE result set simply reports that it completed, and the number of rows that it INSERTed/UPDATEd/DELETEdd.
    Generic Misc result set creation.
    getMultiProbeTableScanResultSet(Activation activation, long conglomId, int scociItem, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, DataValueDescriptor[] probeVals, int sortRequired, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    Multi-probing scan that probes an index for specific values contained in the received probe list.
    getNestedLoopJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, GeneratedMethod joinClause, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String userSuppliedOptimizerOverrides)
    A nested loop left outer join result set forms a result set on top of 2 other result sets.
    getNestedLoopLeftOuterJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, GeneratedMethod joinClause, int resultSetNumber, GeneratedMethod emptyRowFun, boolean wasRightOuterJoin, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String userSuppliedOptimizerOverrides)
    A nested loop join result set forms a result set on top of 2 other result sets.
    getNormalizeResultSet(NoPutResultSet source, int resultSetNumber, int erdNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost, boolean forUpdate)
    REMIND: needs more description...
    getOnceResultSet(NoPutResultSet source, 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.
    getProjectRestrictResultSet(NoPutResultSet source, GeneratedMethod restriction, GeneratedMethod projection, int resultSetNumber, GeneratedMethod constantRestriction, int mapRefItem, int cloneMapItem, boolean reuseResult, boolean doesProjection, boolean validatingCheckConstraint, String validatingBaseTableUUIDString, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    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.
    getRaDependentTableScanResultSet(Activation activation, long conglomId, int scociItem, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String parentResultSetId, long fkIndexConglomId, int fkColArrayItem, int rltItem)
    a referential action dependent table scan generator.
    getRowCountResultSet(NoPutResultSet source, Activation activation, int resultSetNumber, GeneratedMethod offsetMethod, GeneratedMethod fetchFirstMethod, boolean hasJDBClimitClause, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    This result sets implements the filtering needed by and .
    getRowResultSet(Activation activation, GeneratedMethod row, boolean canCacheRow, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    A row result set forms a result set on a single, known row value.
    getScalarAggregateResultSet(NoPutResultSet source, boolean isInSortedOrder, int aggregateItem, int orderItem, int rowAllocator, int maxRowSize, int resultSetNumber, boolean singleInputRow, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    A ScalarAggregateResultSet computes non-distinct scalar aggregates.
    getScrollInsensitiveResultSet(NoPutResultSet source, Activation activation, int resultSetNumber, int sourceRowWidth, boolean scrollable, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    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.
    getSetOpResultSet(NoPutResultSet leftSource, NoPutResultSet rightSource, Activation activation, int resultSetNumber, long optimizerEstimatedRowCount, double optimizerEstimatedCost, int opType, boolean all, int intermediateOrderByColumnsSavedObject, int intermediateOrderByDirectionSavedObject, int intermediateOrderByNullsLowSavedObject)
    The SetOpResultSet is used to implement an INTERSECT or EXCEPT operation.
     
    getSortResultSet(NoPutResultSet source, boolean distinct, boolean isInSortedOrder, int orderItem, int rowAllocator, int maxRowSize, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    A sort result set sorts its source and if requested removes duplicates.
    getTableScanResultSet(Activation activation, long conglomId, int scociItem, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    a minimal table scan generator, for ease of use at present.
    getUnionResultSet(NoPutResultSet leftResultSet, NoPutResultSet rightResultSet, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    a minimal union scan generator, for ease of use at present.
    getUpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM)
    An update result set simply reports that it completed, and the number of rows updated.
     
    getValidateCheckConstraintResultSet(Activation activation, long conglomId, int scociItem, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    A table scan result set forms a result set on a scan of a table.
    getVTIResultSet(Activation activation, int row, int resultSetNumber, GeneratedMethod constructor, String javaClassName, Qualifier[][] pushedQualifiers, int erdNumber, boolean version2, boolean reuseablePs, int ctcNumber, boolean isTarget, int scanIsolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost, boolean isDerbyStyleTableFunction, int returnTypeNumber, int vtiProjectionNumber, int vtiRestrictionNumber, String vtiSchema, String vtiName)
    A VTI result set wraps a user supplied result set.
    getWindowResultSet(Activation activation, NoPutResultSet source, int rowAllocator, int resultSetNumber, int erdNumber, GeneratedMethod restriction, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
    A OLAP window on top of a regular result set.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait