| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | checkForAnyExistingDeleteConnectionViolations(DataDictionary dd, TableDescriptor td, int refActionType, Hashtable<String, Integer> newDconnHashTable, String myConstraintName)
|
| private static void | checkForMultiplePathInvalidCases(int currentRefAction, int refActionType, String myConstraintName, String currentRefTableName)
|
| public static boolean | |
| private static StandardException | |
| private static StandardException | |
| private static StandardException | |
| public static ColumnDescriptorList | |
| private static int | getCurrentDeleteConnections(DataDictionary dd, TableDescriptor td, int refActionType, Hashtable<String, Integer> dch, boolean prevNotCascade, boolean findSelfRef)
Finds the existing delete connection for the table and the referential actions that will occur and stores the information in the hash table. |
| public static ReferencedKeyConstraintDescriptor | locateReferencedConstraint(DataDictionary dd, TableDescriptor td, String myConstraintName, String[] myColumnNames, ConsInfo otherConstraintInfo)
|
| private static void | validateDeleteConnection(DataDictionary dd, TableDescriptor actualTd, TableDescriptor refTd, int refActionType, Hashtable<String, Integer> dch, Hashtable<String, Integer> ech, boolean checkImmediateRefTable, String myConstraintName, boolean prevNotCascade, StringBuffer cycleString, String currentRefTableName, boolean isSelfReferencingFk, int currentSelfRefValue)
The following function validates whether the new foreign key relationship violates any restriction on the referential actions. |
| public static void | validateReferentialActions(DataDictionary dd, TableDescriptor td, String myConstraintName, ConsInfo otherConstraintInfo, String[] columnNames)
|
| DDUtils | back to summary |
|---|---|
| public DDUtils() | |
| checkForAnyExistingDeleteConnectionViolations | back to summary |
|---|---|
private static void checkForAnyExistingDeleteConnectionViolations(DataDictionary dd, TableDescriptor td, int refActionType, Hashtable<String, Integer> newDconnHashTable, String myConstraintName) throws StandardException
| |
| checkForMultiplePathInvalidCases | back to summary |
|---|---|
| private static void checkForMultiplePathInvalidCases(int currentRefAction, int refActionType, String myConstraintName, String currentRefTableName) throws StandardException | |
| columnNamesMatch | back to summary |
|---|---|
| public static boolean columnNamesMatch(String[] columnNames, ColumnDescriptorList cdl) throws StandardException | |
| generateError | back to summary |
|---|---|
| private static StandardException generateError(String messageId, String myConstraintName) | |
| generateError | back to summary |
|---|---|
| private static StandardException generateError(String messageId, String myConstraintName, int raRule) | |
| generateError | back to summary |
|---|---|
| private static StandardException generateError(String messageId, String myConstraintName, String refTableName) | |
| getColumnDescriptors | back to summary |
|---|---|
| public static ColumnDescriptorList getColumnDescriptors(DataDictionary dd, TableDescriptor td, String[] columnNames) throws StandardException | |
| getCurrentDeleteConnections | back to summary |
|---|---|
| private static int getCurrentDeleteConnections(DataDictionary dd, TableDescriptor td, int refActionType, Hashtable<String, Integer> dch, boolean prevNotCascade, boolean findSelfRef) throws StandardException Finds the existing delete connection for the table and the referential actions that will occur and stores the information in the hash table. HashTable (key , value) = ( table name that this table is delete connected to, referential action that will occur if there is a delete on the table this table connected to [CASCADE, SET NULL, RESTRICT, NO ACTION] )
| |
| locateReferencedConstraint | back to summary |
|---|---|
| public static ReferencedKeyConstraintDescriptor locateReferencedConstraint(DataDictionary dd, TableDescriptor td, String myConstraintName, String[] myColumnNames, ConsInfo otherConstraintInfo) throws StandardException | |
| validateDeleteConnection | back to summary |
|---|---|
| private static void validateDeleteConnection(DataDictionary dd, TableDescriptor actualTd, TableDescriptor refTd, int refActionType, Hashtable<String, Integer> dch, Hashtable<String, Integer> ech, boolean checkImmediateRefTable, String myConstraintName, boolean prevNotCascade, StringBuffer cycleString, String currentRefTableName, boolean isSelfReferencingFk, int currentSelfRefValue) throws StandardException The following function validates whether the new foreign key relationship violates any restriction on the referential actions. The current refAction implementation does not allow cases where we can possible land up having multiple action for the same row in a table. This could happen because the user can possibly define different actions through multiple foreign key paths. The following function throws an error while creating foreign keys if the new releationship leads to any such conditions. Note The SQL99 standard also does not clearly says what we are supposed to do in these cases. Our implementation just follows what is done in DB2 and throws error messaged similar to DB2 (sql0632N, sql0633N, sql0634N).
| |
| validateReferentialActions | back to summary |
|---|---|
public static void validateReferentialActions(DataDictionary dd, TableDescriptor td, String myConstraintName, ConsInfo otherConstraintInfo, String[] columnNames) throws StandardException
| |