Class DeleteCascadeResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
org.apache.derby.impl.sql.execute.DMLWriteResultSet
org.apache.derby.impl.sql.execute.DeleteResultSet
org.apache.derby.impl.sql.execute.DeleteCascadeResultSet
- All Implemented Interfaces:
ResultSet
Delete the rows from the specified base table and executes delete/update
on dependent tables depending on the referential actions specified.
Note:(beetle:5197) Dependent Resultsets of DeleteCascade Resultset can in
any one of the multiple resultsets generated for the same table because of
multiple foreign key relationship to the same table. At the bind time ,
dependents are binded only once per table.
We can not depend on mainNodeTable Flag to fire actions on dependents,
it should be done based on whether the resultset has dependent resultsets or not.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean(package private) ResultSet[]private booleanprivate intprivate final Stringprivate intFields inherited from class DeleteResultSet
cascadeDelete, constants, deferredBaseCC, deferredBaseRow, deferredRLRow, deferredSparseRow, fkInfoArray, lockMode, numberOfBaseColumns, numIndexes, rc, rowHolder, savedSource, sourceFields inherited from class DMLWriteResultSet
baseRowReadMap, cachedDestinations, constantAction, heapDCOCI, indexDCOCIs, resultDescription, rowCount, streamStorableHeapColIdsFields inherited from class NoRowsResultSetImpl
activation, beginExecutionTime, beginTime, endExecutionTime, endTime, lccFields inherited from interface ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST -
Constructor Summary
ConstructorsConstructorDescriptionDeleteCascadeResultSet(NoPutResultSet source, Activation activation, int constantActionItem, ResultSet[] dependentResultSets, String resultSetId) -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp()Tells the system to clean up on an error.(package private) booleancollectAffectedRows(boolean rowsFound) (package private) voidvoidfinish()Tells the system that there will be no more access to any database information via this result set; in particular, no more calls to open().(package private) void(package private) voidfireBeforeTriggers(HashMap<String, String> msht) private booleanprivate voidprivate voidmergeRowHolders(HashMap<String, String> msht) voidopen()Needs to be called before the result set will do anything.private void(package private) voidrunFkChecker(boolean restrictCheckOnly) Make sure foreign key constraints are not violatedprivate void(package private) voidsetup()Gathers the rows that needs to be deleted/updated and creates a temporary resulsets that will be passed as source to its dependent result sets.Methods inherited from class DeleteResultSet
close, collectAffectedRows, createDependentSource, fireBeforeTriggersMethods inherited from class DMLWriteResultSet
decodeLockMode, getIndexNameFromCID, getNextRowCore, getResultDescription, makeDeferredSparseRow, modifiedRowCount, normalizeRow, rememberConstraintMethods inherited from class NoRowsResultSetImpl
addWarning, checkRowPosition, clearCurrentRow, close, doesCommit, evaluateGenerationClauses, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCurrentTimeMillis, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getQueryPlanText, getRelativeRow, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
-
Field Details
-
dependentResultSets
ResultSet[] dependentResultSets -
noDependents
private int noDependents -
resultSetId
-
mainNodeForTable
private boolean mainNodeForTable -
affectedRows
private boolean affectedRows -
tempRowHolderId
private int tempRowHolderId
-
-
Constructor Details
-
DeleteCascadeResultSet
public DeleteCascadeResultSet(NoPutResultSet source, Activation activation, int constantActionItem, ResultSet[] dependentResultSets, String resultSetId) throws StandardException - Throws:
StandardException
-
-
Method Details
-
open
Description copied from interface:ResultSetNeeds to be called before the result set will do anything. Need to call before getNextRow(), or for a result set that doesn't return rows, this is the call that will cause all the work to be done.- Specified by:
openin interfaceResultSet- Overrides:
openin classDeleteResultSet- Throws:
StandardException- Standard Derby error policy
-
setup
Gathers the rows that needs to be deleted/updated and creates a temporary resulsets that will be passed as source to its dependent result sets.- Overrides:
setupin classDeleteResultSet- Throws:
StandardException- thrown on error
-
collectAffectedRows
- Throws:
StandardException
-
fireBeforeTriggers
- Throws:
StandardException
-
fireAfterTriggers
- Overrides:
fireAfterTriggersin classDeleteResultSet- Throws:
StandardException
-
deleteDeferredRows
- Overrides:
deleteDeferredRowsin classDeleteResultSet- Throws:
StandardException
-
runFkChecker
Description copied from class:DeleteResultSetMake sure foreign key constraints are not violated- Overrides:
runFkCheckerin classDeleteResultSet- Throws:
StandardException
-
cleanUp
Description copied from interface:ResultSetTells the system to clean up on an error.- Specified by:
cleanUpin interfaceResultSet- Overrides:
cleanUpin classDeleteResultSet- Throws:
StandardException- Thrown on error- See Also:
-
rowChangerFinish
- Throws:
StandardException
-
mergeRowHolders
- Throws:
StandardException
-
mergeResultSets
- Throws:
StandardException
-
finish
Description copied from interface:ResultSetTells the system that there will be no more access to any database information via this result set; in particular, no more calls to open(). Will close the result set if it is not already closed.- Specified by:
finishin interfaceResultSet- Overrides:
finishin classDeleteResultSet- Throws:
StandardException- on error
-
isMultipleDeletePathsExist
private boolean isMultipleDeletePathsExist() -
setRowHoldersTypeToUniqueStream
private void setRowHoldersTypeToUniqueStream()
-