| java.lang.Object com.salmonllc.sql.IntegrityChecker
IntegrityChecker | public class IntegrityChecker (Code) | | This class performs referential integrity checking functions even if the underlying database doesn't.
Each IntegrityChecker object should correspond to a single DataStore. The object may contain rules
that are checked for inserts/updates as well as rules to be checked before a row is to be deleted.
Note: The column within the datastore and the column in the external table we are checking must be
of the same data type.
author: Tyler Williams http://www.dataterrace.com |
IntegrityChecker | public IntegrityChecker(String appName, DataStore ds)(Code) | | Constructs a new integrity checker object and initializes variables.
Parameters: appName - The application to get the default database connection for. Parameters: ds - The data store containing the rows we will be checking for integrity |
addDeleteRefCheck | public void addDeleteRefCheck(String localColumn, String externalTable, String externalColumn) throws DataStoreException(Code) | | Adds a referential integrity rule that will be used on deletion attempts.
Note: The localColumn and the externalColumn must be of the same data type.
Parameters: localColumn - The column within this IntegrityChecker object's DataStore _ds. Parameters: externalTable - The external table we will use to check against the internal column. Parameters: externalColumn - The external column we will use to check against the internal column. throws: DataStoreException - when the local or external column or external table are not found. |
addInsertUpdateRefCheck | public void addInsertUpdateRefCheck(String localColumn, String externalTable, String externalColumn) throws DataStoreException(Code) | | Adds a referential integrity rule that will be used on insert/update attempts.
Note: The localColumn and the externalColumn must be of the same data type.
Parameters: localColumn - The column within this IntegrityChecker object's DataStore _ds. Parameters: externalTable - The external table we will use to check against the internal column. Parameters: externalColumn - The external column we will use to check against the internal column. throws: DataStoreException - when the local or external column or external table are not found. |
isRowOKToDelete | public IntegrityMessage isRowOKToDelete(int row) throws DataStoreException(Code) | | A method that checks whether a row passes the rules for allowing deletion.
Parameters: row - The row within DataStore _ds that we are checking the integrity of. throws: DataStoreException - when the local column doesn't contain data. |
isRowOKToInsertOrUpdate | public IntegrityMessage isRowOKToInsertOrUpdate(int row) throws DataStoreException(Code) | | A method that checks whether a row passes the rules for allowing updating/insertion.
Parameters: row - The row within DataStore _ds that we are checking the integrity of. throws: DataStoreException - when the local column doesn't contain data. |
|
|