Class UniqueConstraint

java.lang.Object
liquibase.structure.AbstractDatabaseObject
liquibase.structure.core.UniqueConstraint
All Implemented Interfaces:
Comparable, LiquibaseSerializable, DatabaseObject

public class UniqueConstraint extends AbstractDatabaseObject
  • Constructor Details

    • UniqueConstraint

      public UniqueConstraint()
    • UniqueConstraint

      public UniqueConstraint(String name, String tableCatalog, String tableSchema, String tableName, Column... columns)
  • Method Details

    • getContainingObjects

      public DatabaseObject[] getContainingObjects()
    • getName

      public String getName()
    • setName

      public UniqueConstraint setName(String constraintName)
      Description copied from interface: DatabaseObject
      Sets the name for the database object.
      Parameters:
      constraintName - 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).
    • getSchema

      public Schema getSchema()
    • getTable

      @Deprecated public Table getTable()
      Deprecated.
    • setTable

      @Deprecated public UniqueConstraint setTable(Table table)
      Deprecated.
    • getRelation

      public Relation getRelation()
    • setRelation

      public UniqueConstraint setRelation(Relation relation)
    • getColumns

      public List<Column> getColumns()
    • setColumns

      public UniqueConstraint setColumns(List<Column> columns)
    • addColumn

      public UniqueConstraint addColumn(int position, Column column)
    • isDeferrable

      public boolean isDeferrable()
    • setDeferrable

      public UniqueConstraint setDeferrable(boolean deferrable)
    • shouldValidate

      public boolean shouldValidate()
      In Oracle PL/SQL, the VALIDATE keyword defines whether a newly added unique constraint on a column in a table should cause existing rows to be checked to see if they satisfy the uniqueness constraint or not.
      Returns:
      true if ENABLE VALIDATE (this is the default), or false if ENABLE NOVALIDATE.
    • setShouldValidate

      public UniqueConstraint 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 constraints - only new data would be checked to see if it complies with the constraint logic. The default state for unique constraints is to have 'ENABLE VALIDATE' set.
    • isInitiallyDeferred

      public boolean isInitiallyDeferred()
    • setInitiallyDeferred

      public UniqueConstraint setInitiallyDeferred(boolean initiallyDeferred)
    • getColumnNames

      public String getColumnNames()
    • setDisabled

      public UniqueConstraint setDisabled(boolean disabled)
    • isDisabled

      public boolean isDisabled()
    • getBackingIndex

      public Index getBackingIndex()
    • setBackingIndex

      public UniqueConstraint setBackingIndex(Index backingIndex)
    • setClustered

      public UniqueConstraint setClustered(boolean clustered)
    • isClustered

      public boolean isClustered()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • compareTo

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

      public void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException
      Specified by:
      load in interface LiquibaseSerializable
      Overrides:
      load in class AbstractDatabaseObject
      Throws:
      ParsedNodeException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class AbstractDatabaseObject