public class UniqueConstraint extends AbstractDatabaseObject
LiquibaseSerializable.SerializationType
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
Constructor and Description |
---|
UniqueConstraint() |
UniqueConstraint(String name,
String tableCatalog,
String tableSchema,
String tableName,
Column... columns) |
Modifier and Type | Method and Description |
---|---|
UniqueConstraint |
addColumn(int position,
Column column) |
int |
compareTo(Object other) |
boolean |
equals(Object o) |
Index |
getBackingIndex() |
String |
getColumnNames() |
List<Column> |
getColumns() |
DatabaseObject[] |
getContainingObjects() |
String |
getName() |
Relation |
getRelation() |
Schema |
getSchema() |
Table |
getTable()
Deprecated.
Use
getRelation() |
int |
hashCode() |
boolean |
isClustered() |
boolean |
isDeferrable() |
boolean |
isDisabled() |
boolean |
isInitiallyDeferred() |
void |
load(ParsedNode parsedNode,
ResourceAccessor resourceAccessor) |
UniqueConstraint |
setBackingIndex(Index backingIndex) |
UniqueConstraint |
setClustered(boolean clustered) |
UniqueConstraint |
setColumns(List<Column> columns) |
UniqueConstraint |
setDeferrable(boolean deferrable) |
UniqueConstraint |
setDisabled(boolean disabled) |
UniqueConstraint |
setInitiallyDeferred(boolean initiallyDeferred) |
UniqueConstraint |
setName(String constraintName)
Sets the name for the database object.
|
UniqueConstraint |
setRelation(Relation relation) |
UniqueConstraint |
setShouldValidate(boolean shouldValidate) |
UniqueConstraint |
setTable(Table table)
Deprecated.
|
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.
|
String |
toString() |
getAttribute, getAttribute, getAttributes, getObjectTypeName, getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, getSerializedObjectName, getSerializedObjectNamespace, getSnapshotId, serialize, setAttribute, setSnapshotId, shouldIncludeCatalogInSpecification, snapshotByDefault
public DatabaseObject[] getContainingObjects()
public String getName()
public UniqueConstraint setName(String constraintName)
DatabaseObject
constraintName
- the new name for the database objectpublic Schema getSchema()
@Deprecated public Table getTable()
getRelation()
@Deprecated public UniqueConstraint setTable(Table table)
setRelation(Relation)
public Relation getRelation()
public UniqueConstraint setRelation(Relation relation)
public UniqueConstraint setColumns(List<Column> columns)
public UniqueConstraint addColumn(int position, Column column)
public boolean isDeferrable()
public UniqueConstraint setDeferrable(boolean deferrable)
public boolean shouldValidate()
public UniqueConstraint setShouldValidate(boolean shouldValidate)
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.public boolean isInitiallyDeferred()
public UniqueConstraint setInitiallyDeferred(boolean initiallyDeferred)
public String getColumnNames()
public UniqueConstraint setDisabled(boolean disabled)
public boolean isDisabled()
public Index getBackingIndex()
public UniqueConstraint setBackingIndex(Index backingIndex)
public UniqueConstraint setClustered(boolean clustered)
public boolean isClustered()
public int compareTo(Object other)
compareTo
in interface Comparable
compareTo
in class AbstractDatabaseObject
public void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException
load
in interface LiquibaseSerializable
load
in class AbstractDatabaseObject
ParsedNodeException
public String toString()
toString
in class AbstractDatabaseObject
Copyright © 2023 Liquibase.org. All rights reserved.