Top Description Fields Constructors Methods
liquibase.change

public Class ConstraintsConfig

extends AbstractLiquibaseSerializable
Class Inheritance
Imports
liquibase.exception.UnexpectedLiquibaseException, liquibase.parser.core.ParsedNode, .ParsedNodeException, liquibase.resource.ResourceAccessor, liquibase.serializer.AbstractLiquibaseSerializable, liquibase.util.StringUtil

The standard configuration used by Change classes to represent a constraints on a column.

Field Summary

Modifier and TypeField and Description
private String
private Boolean
private Boolean
private String
private Boolean
private String
private Boolean
private Boolean
private String
private String
private String
private String
private String
private String
private String
private Boolean
private String
private Boolean
private Boolean
private Boolean
private Boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getCheckConstraint()

Returns the check constraint to use on this column.

public String
getForeignKeyName()

Returns the name to use for the columns foreign key constraint.

public String

Returns:

not null constraint name
getNotNullConstraintName
()

If isNullable() is 'false' and database supports named not null constraints

public String
getPrimaryKeyName()

Returns the name to use for the primary key constraint.

public String
getPrimaryKeyTablespace()

Returns the tablespace to use for the defined primary key.

public String
public String
public String
public String
public String
getReferences()

Returns the "references" clause to use for the foreign key.

public String
public String
public String
getUniqueConstraintName()

Returns the name to use for the unique constraint.

public Boolean
getValidateForeignKey()

Returns whether a ForeignKeyConst defined for this column should validate.

public Boolean
getValidateNullable()

Returns whether a NotNullConst defined for this column should validate.

public Boolean
getValidatePrimaryKey()

Returns whether a PrimaryKeyConst defined for this column should validate.

public Boolean
getValidateUnique()

Returns whether a UniqueConst defined for this column should validate.

public Boolean
isDeferrable()

Returns if a foreign key defined for this column should deferrable.

public Boolean
isDeleteCascade()

Returns if a foreign key defined for this column should cascade deletes.

public Boolean
isInitiallyDeferred()

Returns if a foreign key defined for this column should be "initially deferred".

public Boolean
isNullable()

Returns if the column should be nullable.

public Boolean
isPrimaryKey()

Returns true if the column should be part of the primary key.

public Boolean
isUnique()

Returns if the column is part of a unique constraint.

public void
private Boolean
public ConstraintsConfig
setCheckConstraint(String checkConstraint)

public ConstraintsConfig
setDeferrable(Boolean deferrable)

public ConstraintsConfig
setDeferrable(String deferrable)

Set the deferrable parameter based on the passed string.

public ConstraintsConfig
setDeleteCascade(Boolean deleteCascade)

public ConstraintsConfig
setDeleteCascade(String deleteCascade)

Set the deleteCascade parameter based on the passed string.

public ConstraintsConfig
setForeignKeyName(String foreignKeyName)

public ConstraintsConfig
setInitiallyDeferred(Boolean initiallyDeferred)

public ConstraintsConfig
setInitiallyDeferred(String initiallyDeferred)

Set the initiallyDeferred parameter based on the passed string.

public ConstraintsConfig
setNotNullConstraintName(String notNullConstraintName)

public ConstraintsConfig
setNullable(Boolean nullable)

public ConstraintsConfig
setNullable(String nullable)

Set the nullable parameter based on the passed string.

public ConstraintsConfig
setPrimaryKey(Boolean primaryKey)

public ConstraintsConfig
setPrimaryKey(String primaryKey)

Set the primaryKey parameter based on the passed string.

public ConstraintsConfig
setPrimaryKeyName(String primaryKeyName)

public ConstraintsConfig
setPrimaryKeyTablespace(String primaryKeyTablespace)

public void
setReferencedColumnNames(String referencedColumnNames)

public void
setReferencedTableCatalogName(String referencedTableCatalogName)

public void
setReferencedTableName(String referencedTableName)

public void
setReferencedTableSchemaName(String referencedTableSchemaName)

public ConstraintsConfig
setReferences(String references)

public ConstraintsConfig
public ConstraintsConfig
setUnique(String unique)

Set the unique parameter based on the passed string.

public ConstraintsConfig
setUniqueConstraintName(String uniqueConstraintName)

public ConstraintsConfig
setValidateForeignKey(String validateForeignKey)

Set the validateForeignKey field based on the passed string.

public ConstraintsConfig
setValidateForeignKey(Boolean validateForeignKey)

public ConstraintsConfig
setValidateNullable(String validateNullable)

Set the validateNullable field based on the passed string.

public ConstraintsConfig
setValidateNullable(Boolean validateNullable)

public ConstraintsConfig
setValidatePrimaryKey(String validatePrimaryKey)

Set the validatePrimaryKey field based on the passed string.

public ConstraintsConfig
setValidatePrimaryKey(Boolean validatePrimaryKey)

public ConstraintsConfig
setValidateUnique(String validateUnique)

Set the validateUnique field based on the passed string.

public ConstraintsConfig
setValidateUnique(Boolean validateUnique)

Inherited from liquibase.serializer.AbstractLiquibaseSerializable:
convertEscapedgetSerializableFieldDataTypeClassgetSerializableFieldDataTypeClassParametersgetSerializableFieldNamespacegetSerializableFieldsgetSerializableFieldTypegetSerializableFieldValueserializeserializeValuesetSerializableFieldValueshouldAutoLoad

Field Detail

checkConstraintback to summary
private String checkConstraint
deferrableback to summary
private Boolean deferrable
deleteCascadeback to summary
private Boolean deleteCascade
foreignKeyNameback to summary
private String foreignKeyName
initiallyDeferredback to summary
private Boolean initiallyDeferred
notNullConstraintNameback to summary
private String notNullConstraintName
nullableback to summary
private Boolean nullable
primaryKeyback to summary
private Boolean primaryKey
primaryKeyNameback to summary
private String primaryKeyName
primaryKeyTablespaceback to summary
private String primaryKeyTablespace
referencedColumnNamesback to summary
private String referencedColumnNames
referencedTableCatalogNameback to summary
private String referencedTableCatalogName
referencedTableNameback to summary
private String referencedTableName
referencedTableSchemaNameback to summary
private String referencedTableSchemaName
referencesback to summary
private String references
uniqueback to summary
private Boolean unique
uniqueConstraintNameback to summary
private String uniqueConstraintName
validateForeignKeyback to summary
private Boolean validateForeignKey
validateNullableback to summary
private Boolean validateNullable
validatePrimaryKeyback to summary
private Boolean validatePrimaryKey
validateUniqueback to summary
private Boolean validateUnique

Constructor Detail

ConstraintsConfigback to summary
public ConstraintsConfig()

Method Detail

getCheckConstraintback to summary
public String getCheckConstraint()

Returns the check constraint to use on this column. Returns null if not specified

getForeignKeyNameback to summary
public String getForeignKeyName()

Returns the name to use for the columns foreign key constraint. Returns null if not specified.

getNotNullConstraintNameback to summary
public String getNotNullConstraintName()

If isNullable() is 'false' and database supports named not null constraints

Returns:String

not null constraint name

See Also
getUniqueConstraintName()
getPrimaryKeyNameback to summary
public String getPrimaryKeyName()

Returns the name to use for the primary key constraint. Returns null if not specified

getPrimaryKeyTablespaceback to summary
public String getPrimaryKeyTablespace()

Returns the tablespace to use for the defined primary key. Returns null if not specified.

getReferencedColumnNamesback to summary
public String getReferencedColumnNames()
getReferencedTableCatalogNameback to summary
public String getReferencedTableCatalogName()
getReferencedTableNameback to summary
public String getReferencedTableName()
getReferencedTableSchemaNameback to summary
public String getReferencedTableSchemaName()
getReferencesback to summary
public String 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

getSerializedObjectNameback to summary
public String getSerializedObjectName()

Implements liquibase.serializer.LiquibaseSerializable.getSerializedObjectName.

Annotations
@Override
getSerializedObjectNamespaceback to summary
public String getSerializedObjectNamespace()

Implements liquibase.serializer.LiquibaseSerializable.getSerializedObjectNamespace.

Annotations
@Override
getUniqueConstraintNameback to summary
public String getUniqueConstraintName()

Returns the name to use for the unique constraint. Returns null if not specified

getValidateForeignKeyback to summary
public Boolean getValidateForeignKey()

Returns whether a ForeignKeyConst defined for this column should validate. Returns null if not setValidateForeignKey has not been called.

getValidateNullableback to summary
public Boolean getValidateNullable()

Returns whether a NotNullConst defined for this column should validate. Returns null if not setValidateNullable has not been called.

getValidatePrimaryKeyback to summary
public Boolean getValidatePrimaryKey()

Returns whether a PrimaryKeyConst defined for this column should validate. Returns null if not setValidatePrimaryKey has not been called.

getValidateUniqueback to summary
public Boolean getValidateUnique()

Returns whether a UniqueConst defined for this column should validate. Returns null if not setValidateUnique has not been called.

isDeferrableback to summary
public Boolean isDeferrable()

Returns if a foreign key defined for this column should deferrable. Returns null if not specified.

isDeleteCascadeback to summary
public Boolean isDeleteCascade()

Returns if a foreign key defined for this column should cascade deletes. Returns null if not specified.

isInitiallyDeferredback to summary
public Boolean isInitiallyDeferred()

Returns if a foreign key defined for this column should be "initially deferred". Returns null if not specified.

isNullableback to summary
public Boolean isNullable()

Returns if the column should be nullable. Returns null if unspecified.

isPrimaryKeyback to summary
public Boolean isPrimaryKey()

Returns true if the column should be part of the primary key. Returns null if unspecified

isUniqueback to summary
public Boolean isUnique()

Returns if the column is part of a unique constraint. Returns null if not specified

loadback to summary
public void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException

Overrides liquibase.serializer.AbstractLiquibaseSerializable.load.

Implements liquibase.serializer.LiquibaseSerializable.load.

Annotations
@Override
parseBooleanback to summary
private Boolean parseBoolean(String value)
setCheckConstraintback to summary
public ConstraintsConfig setCheckConstraint(String checkConstraint)
setDeferrableback to summary
public ConstraintsConfig setDeferrable(Boolean deferrable)
setDeferrableback to summary
public ConstraintsConfig setDeferrable(String deferrable)

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 an UnexpectedLiquibaseException if a different value is passed

setDeleteCascadeback to summary
public ConstraintsConfig setDeleteCascade(Boolean deleteCascade)
setDeleteCascadeback to summary
public ConstraintsConfig setDeleteCascade(String deleteCascade)

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 an UnexpectedLiquibaseException if a different value is passed

setForeignKeyNameback to summary
public ConstraintsConfig setForeignKeyName(String foreignKeyName)
setInitiallyDeferredback to summary
public ConstraintsConfig setInitiallyDeferred(Boolean initiallyDeferred)
setInitiallyDeferredback to summary
public ConstraintsConfig setInitiallyDeferred(String initiallyDeferred)

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 an UnexpectedLiquibaseException if a different value is passed

setNotNullConstraintNameback to summary
public ConstraintsConfig setNotNullConstraintName(String notNullConstraintName)
setNullableback to summary
public ConstraintsConfig setNullable(Boolean nullable)
setNullableback to summary
public ConstraintsConfig setNullable(String nullable)

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 an UnexpectedLiquibaseException if a different value is passed

setPrimaryKeyback to summary
public ConstraintsConfig setPrimaryKey(Boolean primaryKey)
setPrimaryKeyback to summary
public ConstraintsConfig setPrimaryKey(String primaryKey)

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 an UnexpectedLiquibaseException if a different value is passed

setPrimaryKeyNameback to summary
public ConstraintsConfig setPrimaryKeyName(String primaryKeyName)
setPrimaryKeyTablespaceback to summary
public ConstraintsConfig setPrimaryKeyTablespace(String primaryKeyTablespace)
setReferencedColumnNamesback to summary
public void setReferencedColumnNames(String referencedColumnNames)
setReferencedTableCatalogNameback to summary
public void setReferencedTableCatalogName(String referencedTableCatalogName)
setReferencedTableNameback to summary
public void setReferencedTableName(String referencedTableName)
setReferencedTableSchemaNameback to summary
public void setReferencedTableSchemaName(String referencedTableSchemaName)
setReferencesback to summary
public ConstraintsConfig setReferences(String references)
setUniqueback to summary
public ConstraintsConfig setUnique(Boolean unique)
setUniqueback to summary
public ConstraintsConfig setUnique(String unique)

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 an UnexpectedLiquibaseException if a different value is passed

setUniqueConstraintNameback to summary
public ConstraintsConfig setUniqueConstraintName(String uniqueConstraintName)
setValidateForeignKeyback to summary
public ConstraintsConfig setValidateForeignKey(String validateForeignKey)

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 an UnexpectedLiquibaseException if an invalid value is passed

setValidateForeignKeyback to summary
public ConstraintsConfig setValidateForeignKey(Boolean validateForeignKey)
setValidateNullableback to summary
public ConstraintsConfig setValidateNullable(String validateNullable)

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 an UnexpectedLiquibaseException if an invalid value is passed

setValidateNullableback to summary
public ConstraintsConfig setValidateNullable(Boolean validateNullable)
setValidatePrimaryKeyback to summary
public ConstraintsConfig setValidatePrimaryKey(String validatePrimaryKey)

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 an UnexpectedLiquibaseException if an invalid value is passed

setValidatePrimaryKeyback to summary
public ConstraintsConfig setValidatePrimaryKey(Boolean validatePrimaryKey)
setValidateUniqueback to summary
public ConstraintsConfig setValidateUnique(String validateUnique)

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 an UnexpectedLiquibaseException if an invalid value is passed

setValidateUniqueback to summary
public ConstraintsConfig setValidateUnique(Boolean validateUnique)