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

public Class RISetChecker

extends Object
Class Inheritance
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.execute.ExecRow, org.apache.derby.iapi.store.access.TransactionController, org.apache.derby.shared.common.sanity.SanityManager

Checks a set or referential integrity constraints. Used to shield the caller from ReferencedKeyRIChecker and ForeignKeyRICheckers.

Field Summary

Modifier and TypeField and Description
private GenericRIChecker[]
pack-priv LanguageConnectionContext

Constructor Summary

AccessConstructor and Description
public
RISetChecker(LanguageConnectionContext
the language connection context
lcc
,
TransactionController
the xact controller
tc
,
FKInfo[]
the foreign key information
fkInfo
)

Method Summary

Modifier and TypeMethod and Description
public void
close()

clean up

public void
doFKCheck(Activation
the activation
a
,
ExecRow
the row to check
row
)

Check that everything in the row is ok, i.e. that there are no foreign keys in the passed in row that have invalid values.

public void
doPKCheck(Activation
The activation
a
,
ExecRow
The row to check
row
,
boolean
true if the check is relevant only for RESTRICTED referential action.
restrictCheckOnly
,
int
For referenced keys: The required number of duplicates that need to be present. Only used if postCheck==false.
deferredRowReq
)

Check that there are no referenced primary keys in the passed in row.

public void
doRICheck(Activation
the activation
a
,
int
index into fkInfo
index
,
ExecRow
the row to check
row
,
boolean
true if the check is relevant only for RESTRICTED referential action.
restrictCheckOnly
,
int
For referenced keys: the required number of duplicates that need to be present. Only used if postCheck==false.
deferredRowReq
)

Execute the specific RI check on the passed in row.

public void
public void
postCheck(int index)

pack-priv void
reopen()

Do any work needed to reopen our ri checkers for another round of checks.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

checkersback to summary
private GenericRIChecker[] checkers
lccback to summary
pack-priv LanguageConnectionContext lcc

Constructor Detail

RISetCheckerback to summary
public RISetChecker(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

closeback to summary
public void close() throws StandardException

clean up

Exceptions
StandardException:
on error
doFKCheckback to summary
public void doFKCheck(Activation a, ExecRow row) throws StandardException

Check that everything in the row is ok, i.e. that there are no foreign keys in the passed in row that have invalid values.

Parameters
a:Activation

the activation

row:ExecRow

the row to check

Exceptions
StandardException:
on unexpected error, or on a primary/unique key violation
doPKCheckback to summary
public void doPKCheck(Activation a, ExecRow row, boolean restrictCheckOnly, int deferredRowReq) throws StandardException

Check that there are no referenced primary keys in the passed in row. So for each foreign key that references a primary key constraint, make sure that there is no row that matches the values in the passed in row.

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

For referenced keys: The required number of duplicates that need to be present. Only used if postCheck==false.

Exceptions
StandardException:
on unexpected error, or on a primary/unique key violation
doRICheckback to summary
public void doRICheck(Activation a, int index, ExecRow row, boolean restrictCheckOnly, int deferredRowReq) throws StandardException

Execute the specific RI check on the passed in row.

Parameters
a:Activation

the activation

index:int

index into fkInfo

row:ExecRow

the row to check

restrictCheckOnly:boolean

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

deferredRowReq:int

For referenced keys: the required number of duplicates that need to be present. Only used if postCheck==false.

Exceptions
StandardException:
on unexpected error, or on a primary/unique key violation
postCheckback to summary
public void postCheck() throws StandardException
postCheckback to summary
public void postCheck(int index) throws StandardException
reopenback to summary
pack-priv void reopen() throws StandardException

Do any work needed to reopen our ri checkers for another round of checks. Must do a close() first.

Exceptions
StandardException:
on error