| java.lang.Object org.apache.derby.impl.sql.execute.GenericConstantAction org.apache.derby.impl.sql.execute.DDLConstantAction org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction org.apache.derby.impl.sql.execute.ConstraintConstantAction
All known Subclasses: org.apache.derby.impl.sql.execute.DropConstraintConstantAction, org.apache.derby.impl.sql.execute.CreateConstraintConstantAction,
ConstraintConstantAction | abstract public class ConstraintConstantAction extends DDLSingleTableConstantAction (Code) | | This class describes actions that are ALWAYS performed for a
constraint creation at Execution time.
version: 0.1 author: Jerry Brenner |
constraintType | protected int constraintType(Code) | | |
ConstraintConstantAction | ConstraintConstantAction(String constraintName, int constraintType, String tableName, UUID tableId, String schemaName, IndexConstantAction indexAction)(Code) | | Make one of these puppies.
Parameters: constraintName - Constraint name. Parameters: constraintType - Constraint type. Parameters: tableName - Table name. Parameters: tableId - UUID of table. Parameters: schemaName - schema that table and constraint lives in. Parameters: indexAction - IndexConstantAction for constraint (if necessary)RESOLVE - the next parameter should go away once we use UUIDs(Generated constraint names will be based off of uuids) |
getConstraintName | public String getConstraintName()(Code) | | Get the constraint name
the constraint name |
getConstraintType | public int getConstraintType()(Code) | | Get the constraint type.
The constraint type |
getIndexAction | public IndexConstantAction getIndexAction()(Code) | | Get the associated index constant action.
the constant action for the backing index |
validateConstraint | static boolean validateConstraint(String constraintName, String constraintText, TableDescriptor td, LanguageConnectionContext lcc, boolean isCheckConstraint) throws StandardException(Code) | | Evaluate a check constraint or not null column constraint.
Generate a query of the
form SELECT COUNT(*) FROM t where NOT()
and run it by compiling and executing it. Will
work ok if the table is empty and query returns null.
Parameters: constraintName - constraint name Parameters: constraintText - constraint text Parameters: td - referenced table Parameters: lcc - the language connection context Parameters: isCheckConstraint - the constraint is a check constraint true if null constraint passes, false otherwise exception: StandardException - if check constraint fails |
validateFKConstraint | static void validateFKConstraint(TransactionController tc, DataDictionary dd, ForeignKeyConstraintDescriptor fk, ReferencedKeyConstraintDescriptor refcd, ExecRow indexTemplateRow) throws StandardException(Code) | | Make sure that the foreign key constraint is valid
with the existing data in the target table. Open
the table, if there aren't any rows, ok. If there
are rows, open a scan on the referenced key with
table locking at level 2. Pass in the scans to
the BulkRIChecker. If any rows fail, barf.
Parameters: tc - transaction controller Parameters: dd - data dictionary Parameters: fk - foreign key constraint Parameters: refcd - referenced key Parameters: indexTemplateRow - index template row exception: StandardException - on error |
Fields inherited from org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction | protected UUID tableId(Code)(Java Doc)
|
Methods inherited from org.apache.derby.impl.sql.execute.DDLConstantAction | protected String constructToString(String statementType, String objectName)(Code)(Java Doc) static SchemaDescriptor getAndCheckSchemaDescriptor(DataDictionary dd, UUID schemaId, String statementType) throws StandardException(Code)(Java Doc) static SchemaDescriptor getSchemaDescriptorForCreate(DataDictionary dd, Activation activation, String schemaName) throws StandardException(Code)(Java Doc) final void lockTableForDDL(TransactionController tc, long heapConglomerateNumber, boolean exclusiveMode) throws StandardException(Code)(Java Doc) protected void storeConstraintDependenciesOnPrivileges(Activation activation, Dependent dependent, UUID refTableUUID) throws StandardException(Code)(Java Doc) protected void storeViewTriggerDependenciesOnPrivileges(Activation activation, Dependent dependent) throws StandardException(Code)(Java Doc)
|
|
|