Class ForeignKey

All Implemented Interfaces:
Comparable, LiquibaseSerializable, DatabaseObject

public class ForeignKey extends AbstractDatabaseObject
  • Constructor Details

    • ForeignKey

      public ForeignKey()
    • ForeignKey

      public ForeignKey(String name)
    • ForeignKey

      public ForeignKey(String name, String foreignKeyCatalog, String foreignKeySchema, String foreignKeyTable, Column... baseTableColumns)
  • Method Details

    • getContainingObjects

      public DatabaseObject[] getContainingObjects()
    • getSchema

      public Schema getSchema()
    • getPrimaryKeyTable

      public Table getPrimaryKeyTable()
    • setPrimaryKeyTable

      public ForeignKey setPrimaryKeyTable(Table primaryKeyTable)
    • getPrimaryKeyColumns

      public List<Column> getPrimaryKeyColumns()
    • setPrimaryKeyColumns

      public ForeignKey setPrimaryKeyColumns(List<Column> primaryKeyColumns)
    • addPrimaryKeyColumn

      public ForeignKey addPrimaryKeyColumn(Column primaryKeyColumn)
    • getForeignKeyTable

      public Table getForeignKeyTable()
    • setForeignKeyTable

      public ForeignKey setForeignKeyTable(Table foreignKeyTable)
    • getForeignKeyColumns

      public List<Column> getForeignKeyColumns()
    • setForeignKeyColumns

      public ForeignKey setForeignKeyColumns(List<Column> foreignKeyColumns)
    • addForeignKeyColumn

      public ForeignKey addForeignKeyColumn(Column foreignKeyColumn)
    • getName

      public String getName()
    • setName

      public ForeignKey setName(String name)
      Description copied from interface: DatabaseObject
      Sets the name for the database object.
      name - the new name for the database object
      a reference to the same object (implementing classes are expected to return a reference to the same object).
    • toString

      public String toString()
      toString in class AbstractDatabaseObject
    • isDeferrable

      public boolean isDeferrable()
    • setDeferrable

      public ForeignKey setDeferrable(boolean deferrable)
    • isInitiallyDeferred

      public boolean isInitiallyDeferred()
    • setInitiallyDeferred

      public ForeignKey setInitiallyDeferred(boolean initiallyDeferred)
    • shouldValidate

      public boolean shouldValidate()
      In Oracle PL/SQL, the VALIDATE keyword defines whether a foreign key constraint on a column in a table should be checked if it refers to a valid row or not.
      true if ENABLE VALIDATE (this is the default), or false if ENABLE NOVALIDATE.
    • setShouldValidate

      public ForeignKey setShouldValidate(boolean shouldValidate)
      shouldValidate - - if shouldValidate is set to FALSE then the constraint will be created with the 'ENABLE NOVALIDATE' mode. This means the constraint would be created, but that no check will be done to ensure old data has valid foreign keys - only new data would be checked to see if it complies with the constraint logic. The default state for foreign keys is to have 'ENABLE VALIDATE' set.
    • getUpdateRule

      public ForeignKeyConstraintType getUpdateRule()
    • setUpdateRule

      public ForeignKey setUpdateRule(ForeignKeyConstraintType rule)
    • getDeleteRule

      public ForeignKeyConstraintType getDeleteRule()
    • setDeleteRule

      public ForeignKey setDeleteRule(ForeignKeyConstraintType rule)
    • equals

      public boolean equals(Object o)
      equals in class Object
    • hashCode

      public int hashCode()
      hashCode in class Object
    • compareTo

      public int compareTo(Object other)
      Specified by:
      compareTo in interface Comparable
      compareTo in class AbstractDatabaseObject
    • getBackingIndex

      public Index getBackingIndex()
    • setBackingIndex

      public ForeignKey setBackingIndex(Index backingIndex)