Package liquibase.structure.core
Class ForeignKey
java.lang.Object
liquibase.structure.AbstractDatabaseObject
liquibase.structure.core.ForeignKey
- All Implemented Interfaces:
Comparable
,LiquibaseSerializable
,DatabaseObject
-
Nested Class Summary
Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable
LiquibaseSerializable.SerializationType
-
Field Summary
Fields inherited from class liquibase.structure.AbstractDatabaseObject
CURLY_BRACKET_PATTERN
Fields inherited from interface liquibase.serializer.LiquibaseSerializable
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
-
Constructor Summary
ConstructorDescriptionForeignKey
(String name) ForeignKey
(String name, String foreignKeyCatalog, String foreignKeySchema, String foreignKeyTable, Column... baseTableColumns) -
Method Summary
Modifier and TypeMethodDescriptionaddForeignKeyColumn
(Column foreignKeyColumn) addPrimaryKeyColumn
(Column primaryKeyColumn) int
boolean
getName()
int
hashCode()
boolean
boolean
setBackingIndex
(Index backingIndex) setDeferrable
(boolean deferrable) setForeignKeyColumns
(List<Column> foreignKeyColumns) setForeignKeyTable
(Table foreignKeyTable) setInitiallyDeferred
(boolean initiallyDeferred) Sets the name for the database object.setPrimaryKeyColumns
(List<Column> primaryKeyColumns) setPrimaryKeyTable
(Table primaryKeyTable) setShouldValidate
(boolean shouldValidate) boolean
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.toString()
Methods inherited from class liquibase.structure.AbstractDatabaseObject
getAttribute, getAttribute, getAttributes, getObjectTypeName, getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, getSerializedObjectName, getSerializedObjectNamespace, getSnapshotId, load, serialize, setAttribute, setSnapshotId, shouldIncludeCatalogInSpecification, snapshotByDefault
-
Constructor Details
-
ForeignKey
public ForeignKey() -
ForeignKey
-
ForeignKey
-
-
Method Details
-
getContainingObjects
-
getSchema
-
getPrimaryKeyTable
-
setPrimaryKeyTable
-
getPrimaryKeyColumns
-
setPrimaryKeyColumns
-
addPrimaryKeyColumn
-
getForeignKeyTable
-
setForeignKeyTable
-
getForeignKeyColumns
-
setForeignKeyColumns
-
addForeignKeyColumn
-
getName
-
setName
Description copied from interface:DatabaseObject
Sets the name for the database object.- Parameters:
name
- the new name for the database object- Returns:
- a reference to the same object (implementing classes are expected to return a reference to the same object).
-
toString
- Overrides:
toString
in classAbstractDatabaseObject
-
isDeferrable
public boolean isDeferrable() -
setDeferrable
-
isInitiallyDeferred
public boolean isInitiallyDeferred() -
setInitiallyDeferred
-
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.- Returns:
- true if ENABLE VALIDATE (this is the default), or false if ENABLE NOVALIDATE.
-
setShouldValidate
- Parameters:
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
-
setUpdateRule
-
getDeleteRule
-
setDeleteRule
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable
- Overrides:
compareTo
in classAbstractDatabaseObject
-
getBackingIndex
-
setBackingIndex
-