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 boolean
private int
private final String
private int
Fields inherited from class org.apache.derby.impl.sql.execute.DeleteResultSet
cascadeDelete, constants, deferredBaseCC, deferredBaseRow, deferredRLRow, deferredSparseRow, fkInfoArray, lockMode, numberOfBaseColumns, numIndexes, rc, rowHolder, savedSource, source
Fields inherited from class org.apache.derby.impl.sql.execute.DMLWriteResultSet
baseRowReadMap, cachedDestinations, constantAction, heapDCOCI, indexDCOCIs, resultDescription, rowCount, streamStorableHeapColIds
Fields inherited from class org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
activation, beginExecutionTime, beginTime, endExecutionTime, endTime, lcc
Fields inherited from interface org.apache.derby.iapi.sql.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 TypeMethodDescriptionvoid
cleanUp()
Tells the system to clean up on an error.(package private) boolean
collectAffectedRows
(boolean rowsFound) (package private) void
void
finish()
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) void
fireBeforeTriggers
(HashMap<String, String> msht) private boolean
private void
private void
mergeRowHolders
(HashMap<String, String> msht) void
open()
Needs to be called before the result set will do anything.private void
(package private) void
runFkChecker
(boolean restrictCheckOnly) Make sure foreign key constraints are not violatedprivate void
(package private) void
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.Methods inherited from class org.apache.derby.impl.sql.execute.DeleteResultSet
close, collectAffectedRows, createDependentSource, fireBeforeTriggers
Methods inherited from class org.apache.derby.impl.sql.execute.DMLWriteResultSet
decodeLockMode, getIndexNameFromCID, getNextRowCore, getResultDescription, makeDeferredSparseRow, modifiedRowCount, normalizeRow, rememberConstraint
Methods inherited from class org.apache.derby.impl.sql.execute.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:ResultSet
Needs 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:
open
in interfaceResultSet
- Overrides:
open
in 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:
setup
in classDeleteResultSet
- Throws:
StandardException
- thrown on error
-
collectAffectedRows
- Throws:
StandardException
-
fireBeforeTriggers
- Throws:
StandardException
-
fireAfterTriggers
- Overrides:
fireAfterTriggers
in classDeleteResultSet
- Throws:
StandardException
-
deleteDeferredRows
- Overrides:
deleteDeferredRows
in classDeleteResultSet
- Throws:
StandardException
-
runFkChecker
Description copied from class:DeleteResultSet
Make sure foreign key constraints are not violated- Overrides:
runFkChecker
in classDeleteResultSet
- Throws:
StandardException
-
cleanUp
Description copied from interface:ResultSet
Tells the system to clean up on an error.- Specified by:
cleanUp
in interfaceResultSet
- Overrides:
cleanUp
in classDeleteResultSet
- Throws:
StandardException
- Thrown on error- See Also:
-
rowChangerFinish
- Throws:
StandardException
-
mergeRowHolders
- Throws:
StandardException
-
mergeResultSets
- Throws:
StandardException
-
finish
Description copied from interface:ResultSet
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(). Will close the result set if it is not already closed.- Specified by:
finish
in interfaceResultSet
- Overrides:
finish
in classDeleteResultSet
- Throws:
StandardException
- on error
-
isMultipleDeletePathsExist
private boolean isMultipleDeletePathsExist() -
setRowHoldersTypeToUniqueStream
private void setRowHoldersTypeToUniqueStream()
-