Package liquibase.change
Class ConstraintsConfig
java.lang.Object
liquibase.serializer.AbstractLiquibaseSerializable
liquibase.change.ConstraintsConfig
- All Implemented Interfaces:
LiquibaseSerializable
The standard configuration used by Change classes to represent a constraints on a column.
-
Nested Class Summary
Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable
LiquibaseSerializable.SerializationType
-
Field Summary
Fields inherited from interface liquibase.serializer.LiquibaseSerializable
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the check constraint to use on this column.Returns the name to use for the columns foreign key constraint.IfisNullable()
is 'false' and database supports named not null constraintsReturns the name to use for the primary key constraint.Returns the tablespace to use for the defined primary key.Returns the "references" clause to use for the foreign key.Returns the name to use for the unique constraint.Returns whether a ForeignKeyConst defined for this column should validate.Returns whether a NotNullConst defined for this column should validate.Returns whether a PrimaryKeyConst defined for this column should validate.Returns whether a UniqueConst defined for this column should validate.Returns if a foreign key defined for this column should deferrable.Returns if a foreign key defined for this column should cascade deletes.Returns if a foreign key defined for this column should be "initially deferred".Returns if the column should be nullable.Returns true if the column should be part of the primary key.isUnique()
Returns if the column is part of a unique constraint.void
load
(ParsedNode parsedNode, ResourceAccessor resourceAccessor) setCheckConstraint
(String checkConstraint) setDeferrable
(Boolean deferrable) setDeferrable
(String deferrable) Set the deferrable parameter based on the passed string.setDeleteCascade
(Boolean deleteCascade) setDeleteCascade
(String deleteCascade) Set the deleteCascade parameter based on the passed string.setForeignKeyName
(String foreignKeyName) setInitiallyDeferred
(Boolean initiallyDeferred) setInitiallyDeferred
(String initiallyDeferred) Set the initiallyDeferred parameter based on the passed string.setNotNullConstraintName
(String notNullConstraintName) setNullable
(Boolean nullable) setNullable
(String nullable) Set the nullable parameter based on the passed string.setPrimaryKey
(Boolean primaryKey) setPrimaryKey
(String primaryKey) Set the primaryKey parameter based on the passed string.setPrimaryKeyName
(String primaryKeyName) setPrimaryKeyTablespace
(String primaryKeyTablespace) setReferences
(String references) Set the unique parameter based on the passed string.setUniqueConstraintName
(String uniqueConstraintName) setValidateForeignKey
(Boolean validateForeignKey) setValidateForeignKey
(String validateForeignKey) Set the validateForeignKey field based on the passed string.setValidateNullable
(Boolean validateNullable) setValidateNullable
(String validateNullable) Set the validateNullable field based on the passed string.setValidatePrimaryKey
(Boolean validatePrimaryKey) setValidatePrimaryKey
(String validatePrimaryKey) Set the validatePrimaryKey field based on the passed string.setValidateUnique
(Boolean validateUnique) setValidateUnique
(String validateUnique) Set the validateUnique field based on the passed string.Methods inherited from class liquibase.serializer.AbstractLiquibaseSerializable
convertEscaped, getSerializableFieldDataTypeClass, getSerializableFieldDataTypeClassParameters, getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, serialize, serializeValue, setSerializableFieldValue, shouldAutoLoad
-
Constructor Details
-
ConstraintsConfig
public ConstraintsConfig()
-
-
Method Details
-
isNullable
Returns if the column should be nullable. Returns null if unspecified. -
setNullable
-
setNullable
Set the nullable parameter based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if a different value is passed -
getNotNullConstraintName
IfisNullable()
is 'false' and database supports named not null constraints- Returns:
- not null constraint name
- See Also:
-
setNotNullConstraintName
-
isPrimaryKey
Returns true if the column should be part of the primary key. Returns null if unspecified -
setPrimaryKey
-
setPrimaryKey
Set the primaryKey parameter based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if a different value is passed -
getPrimaryKeyName
Returns the name to use for the primary key constraint. Returns null if not specified -
setPrimaryKeyName
-
getReferences
Returns the "references" clause to use for the foreign key. Normally a string of the format TABLE(COLUMN_NAME). Returns null if not specified -
setReferences
-
isUnique
Returns if the column is part of a unique constraint. Returns null if not specified -
setUnique
-
setUnique
Set the unique parameter based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if a different value is passed -
getUniqueConstraintName
Returns the name to use for the unique constraint. Returns null if not specified -
setUniqueConstraintName
-
getCheckConstraint
Returns the check constraint to use on this column. Returns null if not specified -
setCheckConstraint
-
isDeleteCascade
Returns if a foreign key defined for this column should cascade deletes. Returns null if not specified. -
setDeleteCascade
-
setDeleteCascade
Set the deleteCascade parameter based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if a different value is passed -
getForeignKeyName
Returns the name to use for the columns foreign key constraint. Returns null if not specified. -
setForeignKeyName
-
isInitiallyDeferred
Returns if a foreign key defined for this column should be "initially deferred". Returns null if not specified. -
setInitiallyDeferred
-
setInitiallyDeferred
Set the initiallyDeferred parameter based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if a different value is passed -
isDeferrable
Returns if a foreign key defined for this column should deferrable. Returns null if not specified. -
setDeferrable
-
setValidateNullable
Set the validateNullable field based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if an invalid value is passed -
getValidateNullable
Returns whether a NotNullConst defined for this column should validate. Returns null if not setValidateNullable has not been called. -
setValidateNullable
-
setValidateUnique
Set the validateUnique field based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if an invalid value is passed -
getValidateUnique
Returns whether a UniqueConst defined for this column should validate. Returns null if not setValidateUnique has not been called. -
setValidateUnique
-
setValidatePrimaryKey
Set the validatePrimaryKey field based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if an invalid value is passed -
getValidatePrimaryKey
Returns whether a PrimaryKeyConst defined for this column should validate. Returns null if not setValidatePrimaryKey has not been called. -
setValidatePrimaryKey
-
setValidateForeignKey
Set the validateForeignKey field based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if an invalid value is passed -
getValidateForeignKey
Returns whether a ForeignKeyConst defined for this column should validate. Returns null if not setValidateForeignKey has not been called. -
setValidateForeignKey
-
setDeferrable
Set the deferrable parameter based on the passed string. Sets true if the passed string is 1 or true or TRUE. Sets false if the passed string is 0 or false or FALSE. Sets null if the passed string is null or "null" or "NULL". Throws anUnexpectedLiquibaseException
if a different value is passed -
getPrimaryKeyTablespace
Returns the tablespace to use for the defined primary key. Returns null if not specified. -
setPrimaryKeyTablespace
-
getSerializedObjectName
-
getSerializedObjectNamespace
-
load
public void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException - Specified by:
load
in interfaceLiquibaseSerializable
- Overrides:
load
in classAbstractLiquibaseSerializable
- Throws:
ParsedNodeException
-