Class DependentResultSet

  • All Implemented Interfaces:
    CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource

    class DependentResultSet
    extends ScanResultSet
    implements CursorResultSet
    DependentResultSet should be used by only ON DELETE CASCADE/ON DELETE SET NULL ref actions implementation to gather the rows from the dependent tables. Idea is to scan the foreign key index for the rows in the source table materialized temporary result set. Scanning of foreign key index gives us the rows that needs to be deleted on dependent tables. Using the row location we got from the index , base row is fetched.
    • Constructor Detail

      • DependentResultSet

        DependentResultSet​(long conglomId,
                           StaticCompiledOpenConglomInfo scoci,
                           Activation activation,
                           int resultRowTemplate,
                           int resultSetNumber,
                           GeneratedMethod startKeyGetter,
                           int startSearchOperator,
                           GeneratedMethod stopKeyGetter,
                           int stopSearchOperator,
                           boolean sameStartStopPosition,
                           Qualifier[][] qualifiers,
                           java.lang.String tableName,
                           java.lang.String userSuppliedOptimizerOverrides,
                           java.lang.String indexName,
                           boolean isConstraint,
                           boolean forUpdate,
                           int colRefItem,
                           int lockMode,
                           boolean tableLocked,
                           int isolationLevel,
                           int rowsPerRead,
                           boolean oneRowScan,
                           double optimizerEstimatedRowCount,
                           double optimizerEstimatedCost,
                           java.lang.String parentResultSetId,
                           long fkIndexConglomId,
                           int fkColArrayItem,
                           int rltItem)
                    throws StandardException
        Throws:
        StandardException
    • Method Detail

      • openIndexScanController

        private ScanController openIndexScanController​(ExecRow searchRow)
                                                throws StandardException
        Get a scan controller positioned using searchRow as the start/stop position. The assumption is that searchRow is of the same format as the index being opened.
        Parameters:
        searchRow - the row to match
        Throws:
        StandardException - on error
      • setupQualifierRow

        private void setupQualifierRow​(ExecRow searchRow)
      • fetchIndexRow

        private ExecRow fetchIndexRow()
                               throws StandardException
        Fetch a row from the index scan.
        Returns:
        The row or null. Note that the next call to fetch will replace the columns in the returned row.
        Throws:
        StandardException - Ooops
      • openCore

        public void openCore()
                      throws StandardException
        Description copied from interface: NoPutResultSet
        open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...

        openCore() can only be called on a closed result set. see reopenCore if you want to reuse an open result set.

        For NoPutResultSet open() must only be called on the top ResultSet. Opening of NoPutResultSet's below the top result set are implemented by calling openCore.

        Specified by:
        openCore in interface NoPutResultSet
        Throws:
        StandardException - thrown if cursor finished.
      • addNewSources

        private void addNewSources()
      • canGetInstantaneousLocks

        boolean canGetInstantaneousLocks()
        Can we get instantaneous locks when getting share row locks at READ COMMITTED.
        Specified by:
        canGetInstantaneousLocks in class ScanResultSet
      • getTimeSpent

        public long getTimeSpent​(int type)
        Description copied from interface: ResultSet
        Return the total amount of time spent in this ResultSet
        Specified by:
        getTimeSpent in interface ResultSet
        Parameters:
        type - CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.
        Returns:
        long The total amount of time spent (in milliseconds).
      • getRowLocation

        public RowLocation getRowLocation()
                                   throws StandardException
        Description copied from interface: CursorResultSet
        Returns the row location of the current base table row of the cursor. If this cursor's row is composed of multiple base tables' rows, i.e. due to a join, then a null is returned.
        Specified by:
        getRowLocation in interface CursorResultSet
        Returns:
        the row location of the current cursor row.
        Throws:
        StandardException - thrown on failure to get location from storage engine
      • getCurrentRow

        public ExecRow getCurrentRow()
                              throws StandardException
        Description copied from interface: CursorResultSet
        Returns the current row of the result set. REMIND: eventually, this will only return the current row for result sets that need to return it; either some field in the activation or a parameter in the constructor will be used to signal that this needs to function. This will let us limit the number of live objects we are holding on to.

        Specified by:
        getCurrentRow in interface CursorResultSet
        Returns:
        the last row returned by getNextRow. null if closed.
        Throws:
        StandardException - thrown on failure.
      • getScanProperties

        public java.util.Properties getScanProperties()
      • printStartPosition

        public java.lang.String printStartPosition()
      • printStopPosition

        public java.lang.String printStopPosition()
      • printPosition

        private java.lang.String printPosition​(int searchOperator,
                                               ExecIndexRow positioner)
        Return a start or stop positioner as a String. If we already generated the information, then use that. Otherwise, invoke the activation to get it.
      • printQualifiers

        public java.lang.String printQualifiers()
        Return an array of Qualifiers as a String