Package liquibase.statement.core
Class AddForeignKeyConstraintStatement
- java.lang.Object
-
- liquibase.statement.AbstractSqlStatement
-
- liquibase.statement.core.AddForeignKeyConstraintStatement
-
- All Implemented Interfaces:
SqlStatement
public class AddForeignKeyConstraintStatement extends AbstractSqlStatement
-
-
Field Summary
-
Fields inherited from interface liquibase.statement.SqlStatement
EMPTY_SQL_STATEMENT
-
-
Constructor Summary
Constructors Constructor Description AddForeignKeyConstraintStatement(String constraintName, String baseTableCatalogName, String baseTableSchemaName, String baseTableName, ColumnConfig[] baseColumns, String referencedTableCatalogName, String referencedTableSchemaName, String referencedTableName, ColumnConfig[] referencedColumns)
-
Method Summary
-
Methods inherited from class liquibase.statement.AbstractSqlStatement
continueOnError, setContinueOnError, skipOnUnsupported
-
-
-
-
Constructor Detail
-
AddForeignKeyConstraintStatement
public AddForeignKeyConstraintStatement(String constraintName, String baseTableCatalogName, String baseTableSchemaName, String baseTableName, ColumnConfig[] baseColumns, String referencedTableCatalogName, String referencedTableSchemaName, String referencedTableName, ColumnConfig[] referencedColumns)
-
-
Method Detail
-
getBaseTableCatalogName
public String getBaseTableCatalogName()
-
getBaseTableSchemaName
public String getBaseTableSchemaName()
-
getBaseTableName
public String getBaseTableName()
-
getBaseColumns
public ColumnConfig[] getBaseColumns()
-
getBaseColumnNames
public String getBaseColumnNames()
-
getReferencedTableCatalogName
public String getReferencedTableCatalogName()
-
getReferencedTableSchemaName
public String getReferencedTableSchemaName()
-
getReferencedTableName
public String getReferencedTableName()
-
getReferencedColumns
public ColumnConfig[] getReferencedColumns()
-
getReferencedColumnNames
public String getReferencedColumnNames()
-
getConstraintName
public String getConstraintName()
-
isDeferrable
public boolean isDeferrable()
-
getOnDelete
public String getOnDelete()
-
getOnUpdate
public String getOnUpdate()
-
setDeferrable
public AddForeignKeyConstraintStatement setDeferrable(boolean deferrable)
-
isInitiallyDeferred
public boolean isInitiallyDeferred()
-
setInitiallyDeferred
public AddForeignKeyConstraintStatement setInitiallyDeferred(boolean initiallyDeferred)
-
setOnUpdate
public AddForeignKeyConstraintStatement setOnUpdate(String updateRule)
-
setOnDelete
public AddForeignKeyConstraintStatement setOnDelete(String deleteRule)
-
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
public AddForeignKeyConstraintStatement setShouldValidate(boolean shouldValidate)
- 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.
-
-