Package liquibase.structure.core
Class PrimaryKey
java.lang.Object
liquibase.structure.AbstractDatabaseObject
liquibase.structure.core.PrimaryKey
- All Implemented Interfaces:
Comparable
,LiquibaseSerializable
,DatabaseObject
-
Nested Class Summary
Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable
LiquibaseSerializable.SerializationType
-
Field Summary
Fields inherited from class liquibase.structure.AbstractDatabaseObject
CURLY_BRACKET_PATTERN
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 TypeMethodDescriptionAdds a new column to the column list of this PrimaryKey.int
boolean
getName()
getTable()
Returns the Table object this PrimaryKey belongs to.int
hashCode()
boolean
setBackingIndex
(Index backingIndex) setCertainName
(boolean certainName) Sets the name for the database object.setShouldValidate
(boolean shouldValidate) Sets the Table object this PrimaryKey belongs to.setTablespace
(String tablespace) toString()
Methods inherited from class liquibase.structure.AbstractDatabaseObject
getAttribute, getAttribute, getAttributes, getObjectTypeName, getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, getSerializedObjectName, getSerializedObjectNamespace, getSnapshotId, load, serialize, setAttribute, setSnapshotId, shouldIncludeCatalogInSpecification, snapshotByDefault
-
Field Details
-
VALIDATE_ATRIBUTE
- See Also:
-
CLUSTERED_ATTRIBUTE
- See Also:
-
-
Constructor Details
-
PrimaryKey
public PrimaryKey() -
PrimaryKey
-
-
Method Details
-
getContainingObjects
-
getName
-
setName
Description copied from interface:DatabaseObject
Sets the name for the database object.- Parameters:
name
- 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
-
getColumnNames
-
addColumn
Adds a new column to the column list of this PrimaryKey. The first column has the position 0. If you specify a position that is greater than the number of columns present, undefined columns (NULL expressions) will be added as padding. If a position that is already occupied by a column is specified, that column will be replaced.- Parameters:
position
- the position where to insert or replace the columncolumn
- the new column- Returns:
- a reference to the updated PrimaryKey object.
-
getTable
Returns the Table object this PrimaryKey belongs to.- Returns:
- the Table object, or null if not initialized yet.
-
setTable
Sets the Table object this PrimaryKey belongs to.- Parameters:
table
- the table object to set as the container for this PrimaryKey- Returns:
- the updated object
-
compareTo
- Specified by:
compareTo
in interfaceComparable
- Overrides:
compareTo
in classAbstractDatabaseObject
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toString
in classAbstractDatabaseObject
-
getColumns
-
getColumnNamesAsList
-
isCertainName
public boolean isCertainName() -
setCertainName
-
getTablespace
-
setTablespace
-
getBackingIndex
-
setBackingIndex
-
setShouldValidate
- 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 primary keys - only new data would be checked to see if it complies with the constraint logic. The default state for primary keys is to have 'ENABLE VALIDATE' set.
-