Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class ForeignKeyRIChecker

extends GenericRIChecker
Class Inheritance
Imports
org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.sql.Activation, .StatementUtil, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.execute.ExecRow, org.apache.derby.iapi.store.access.ScanController, .TransactionController, org.apache.derby.shared.common.sanity.SanityManager

A Referential Integrity checker for a foreign key constraint. It makes sure the foreign key is intact. This is used for a change to a foreign key column. see ReferencedKeyRIChecker for the code that validates changes to referenced keys.

Field Summary

Inherited from org.apache.derby.impl.sql.execute.GenericRIChecker:
deferredRowsHashTablefkDcocisfkInfofkScocisidentityMapindexQualifierRowlccnumColumnsrefDcocirefScocitc

Constructor Summary

AccessConstructor and Description
pack-priv
ForeignKeyRIChecker(LanguageConnectionContext
the language connection context
lcc
,
TransactionController
the xact controller
tc
,
FKInfo
the foreign key information
fkinfo
)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
doCheck(Activation
the activation
a
,
ExecRow
the row to check
row
,
boolean
true if the check is relevant only for RESTRICTED referential action.
restrictCheckOnly
,
int
dummy (interface obligation only)
deferredRowReq
)

Implements abstract org.apache.derby.impl.sql.execute.GenericRIChecker.doCheck.

Check that the row either has a null column(s), or corresponds to a row in the referenced key.

pack-priv int

Returns:

The isolation level for the scan for the RI check.
getRICheckIsolationLevel
()

Overrides org.apache.derby.impl.sql.execute.GenericRIChecker.getRICheckIsolationLevel.

Get the isolation level for the scan for the RI check.

Inherited from org.apache.derby.impl.sql.execute.GenericRIChecker:
closegetScanControllerisAnyFieldNull

Constructor Detail

ForeignKeyRICheckerback to summary
pack-priv ForeignKeyRIChecker(LanguageConnectionContext lcc, TransactionController tc, FKInfo fkinfo) throws StandardException
Parameters
lcc:LanguageConnectionContext

the language connection context

tc:TransactionController

the xact controller

fkinfo:FKInfo

the foreign key information

Exceptions
StandardException:
Thrown on failure

Method Detail

doCheckback to summary
pack-priv void doCheck(Activation a, ExecRow row, boolean restrictCheckOnly, int deferredRowReq) throws StandardException

Implements abstract org.apache.derby.impl.sql.execute.GenericRIChecker.doCheck.

Check that the row either has a null column(s), or corresponds to a row in the referenced key.

If the referenced key is found, then it is locked when this method returns. The lock is held until the next call to doCheck() or close().

Parameters
a:Activation

the activation

row:ExecRow

the row to check

restrictCheckOnly:boolean

true if the check is relevant only for RESTRICTED referential action.

deferredRowReq:int

dummy (interface obligation only)

Exceptions
StandardException:
on unexpected error, or on a foreign key violation
getRICheckIsolationLevelback to summary
pack-priv int getRICheckIsolationLevel()

Overrides org.apache.derby.impl.sql.execute.GenericRIChecker.getRICheckIsolationLevel.

Get the isolation level for the scan for the RI check.

Note

The level will eventually be instantaneous locking once the implementation changes.

Returns:int

The isolation level for the scan for the RI check.