Package com.tietoenator.trip.jxp.database

# Class TdbIntegrityRule

java.lang.Object
com.tietoenator.trip.jxp.database.TdbIntegrityRule

public class TdbIntegrityRule extends Object
Container and logic related to referential integrity rules between two databases, a master and a slave.
The slave database defines an integrity rule, creating a foreign key field that reflects values stored in the master database. When values are updated in the master database, referential integrity projections ensure that records holding those values in the slave database are updated accordingly (or ensure that values cannot be updated or deleted from the master database, depending on the type of rule).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TdbIntegrityRule()`
  Constructor, creates a blank rule
  `TdbIntegrityRule(TdbIntegrityRule src)`
  Copy constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  Test a rule for equality with another.
  `String`
  `getKey()`
  Retrieve the name of the field that holds the foreign key
  `String`
  `getLinkDatabase()`
  Retrieve the name of the target database for the link
  `String`
  `getLinkField()`
  Retrieve the name of the field in the target database that holds the key for which this rule is a foreign reference.
  `TdbIntegrityType`
  `getOnDelete()`
  Retrieve the action to be taken in the current database if a record in the target database is deleted.
  `TdbIntegrityType`
  `getOnUpdate()`
  Retrieve the action to be taken in the current database if a record in the target database is updated.
  `boolean`
  `isOutgoing()`
  Check if this rule is outgoing (i.e. the current database is the master) or incoming (i.e. the current database is the slave).
  `void`
  `setKey(String key)`
  Establish the name of the field that holds the foreign key
  `void`
  `setLinkDatabase(String database)`
  Establish the name of the target database for the link
  `void`
  `setLinkField(String field)`
  Establish the name of the field in the target database that holds the key for which this rule is a foreign reference.
  `void`
  `setOnDelete(TdbIntegrityType action)`
  Establish the action to be taken in the current database if a record in the target database is deleted.
  `void`
  `setOnUpdate(TdbIntegrityType action)`
  Establish the action to be taken in the current database if a record in the target database is updated.
  `void`
  `setOutgoing(boolean mode)`
  Establish whether this rule is outgoing (i.e. the current database is the master) or incoming (i.e. the current database is the slave).

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TdbIntegrityRule

    public TdbIntegrityRule()
    Constructor, creates a blank rule

  - ### TdbIntegrityRule

    public TdbIntegrityRule(TdbIntegrityRule src)
    Copy constructor
    Parameters:
      `src` - Source from which to copy

- ## Method Details

  - ### getKey

    public String getKey()
    Retrieve the name of the field that holds the foreign key
    Returns:
      Foreign key field

  - ### setKey

    public void setKey(String key)
    Establish the name of the field that holds the foreign key
    Parameters:
      `key` - Foreign key field

  - ### getLinkDatabase

    public String getLinkDatabase()
    Retrieve the name of the target database for the link
    Returns:
      Target database name

  - ### setLinkDatabase

    public void setLinkDatabase(String database)
    Establish the name of the target database for the link
    Parameters:
      `database` - Target database name

  - ### getLinkField

    public String getLinkField()
    Retrieve the name of the field in the target database that holds the key for which this rule is a foreign reference.
    Returns:
      Target field name

  - ### setLinkField

    public void setLinkField(String field)
    Establish the name of the field in the target database that holds the key for which this rule is a foreign reference.
    Parameters:
      `field` - Target field name

  - ### getOnDelete

    public TdbIntegrityType getOnDelete()
    Retrieve the action to be taken in the current database if a record in the target database is deleted.
    Returns:
      The "on delete" action

  - ### setOnDelete

    public void setOnDelete(TdbIntegrityType action)
    Establish the action to be taken in the current database if a record in the target database is deleted.
    Parameters:
      `action` - The "on delete" action

  - ### getOnUpdate

    public TdbIntegrityType getOnUpdate()
    Retrieve the action to be taken in the current database if a record in the target database is updated.
    Returns:
      The "on update" action

  - ### setOnUpdate

    public void setOnUpdate(TdbIntegrityType action)
    Establish the action to be taken in the current database if a record in the target database is updated.
    Parameters:
      `action` - The "on update" action

  - ### isOutgoing

    public boolean isOutgoing()
    Check if this rule is outgoing (i.e. the current database is the master) or incoming (i.e. the current database is the slave). Referential integrity mappings are projected from the master database (outgoing) onto the slave database (incoming).
    Returns:
      true if this database is the master in the foreign key relationship

  - ### setOutgoing

    public void setOutgoing(boolean mode)
    Establish whether this rule is outgoing (i.e. the current database is the master) or incoming (i.e. the current database is the slave). Referential integrity mappings are projected from the master database (outgoing) onto the slave database (incoming).
    Parameters:
      `mode` - true if this database is the master in the foreign key relationship

  - ### equals

    public boolean equals(Object obj)
    Test a rule for equality with another. The test is performed on the Outgoing and Key properties only.
    Overrides:
      `equals` in class `Object`
    Parameters:
      `obj` - Object to test for equality
    Returns:
      true iff the Outgoing and Key properties are equal