public class PurgeSpecification
extends Object
Specification that defines a hierarchy of tables for Purge processing. The PurgeSpec defines the table(s),
primary keys, and the foreign keys used to link the tables.
The specification is designed using a perspective from a root table and traversing into related tables. It is
important that the table references are defined in traversal order so the process knows which tables to purge
first in order that foreign key violations can be avoided. As the hierarchy is defined, the root
table can change if there are groupings of related tables relative to the new root. Once that cluster of
tables are defined the root can return to the previous root table.
Key methods used to define the hierarchy:
addTableRefFromRoot - adds a table name, pkColumn name, and fkColumn name that is fk referenced "from" the root table
addTableRefToRoot - adds a table name, pkColumn name, and fkColumn name that is fk referenced "to" the root table
newRoot - changes the root to the next defined TableRef
endRoot - returns the root to the previous table
This class is designed to use method chaining. For example:
customerPurgeSpec = new PurgeSpec("blc_customer", "customer_id")
.addTableRefToRoot("blc_customer_attribute", "customer_attribute_id", "customer_id")
.newRoot()
.addTableRefToRoot("blc_customer_address", "customer_address_id", "customer_id")
.addTableRefFromRoot("blc_address", "address_id", "address_id")
.endRoot()
.addTableRefToRoot("blc_customer_role", "customer_role_id", "customer_id");
- Author:
- dcolgrove