Class MetaConstraint
java.lang.Object
org.pgcodekeeper.core.database.base.schema.meta.MetaStatement
org.pgcodekeeper.core.database.base.schema.meta.MetaConstraint
- All Implemented Interfaces:
Serializable,IConstraint,IConstraintPk,ISearchPath,IStatement,ISubElement
Represents a database constraint metadata object.
Provides information about table constraints including primary keys and column references.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMetaConstraint(ObjectLocation object) Creates a new constraint metadata object. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a column to this constraint.booleancontainsColumn(String name) Checks if this constraint involves the specified column.Gets the columns involved in this constraint.Returns the containing schema of this constraint.Returns the constraint definition.Returns the schema name of this constraint.Returns the table name of this constraint.booleanChecks if this primary key constraint is clustered.booleanChecks if this constraint is a primary key constraint.voidsetPrimaryKey(boolean isPrimaryKey) Methods inherited from class org.pgcodekeeper.core.database.base.schema.meta.MetaStatement
addDependency, appendAlterSQL, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, compare, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getCreationSQL, getDatabase, getDependencies, getDescendants, getDropSQL, getFilePath, getLibName, getLineNumber, getLocation, getName, getObject, getObjectReference, getObjLength, getOffset, getOwner, getParent, getPrivileges, getQualifiedName, getQuoter, getRenameCommand, getSeparator, getSQL, getStatementType, getTwin, hasChildren, isLib, setComment, setLibName, setLocation, setOwner, shallowCopyMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IConstraint
getStatementTypeMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getDatabaseMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendAlterSQL, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, compare, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getCreationSQL, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getOwner, getParent, getPrivileges, getQualifiedName, getQuotedName, getQuoter, getRenameCommand, getSeparator, getSQL, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopyMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISubElement
toObjectReference
-
Constructor Details
-
MetaConstraint
Creates a new constraint metadata object.- Parameters:
object- the object location information
-
-
Method Details
-
isPrimaryKey
public boolean isPrimaryKey()Description copied from interface:IConstraintChecks if this constraint is a primary key constraint.- Specified by:
isPrimaryKeyin interfaceIConstraint- Returns:
- true if this is a primary key constraint
-
getColumns
Description copied from interface:IConstraintGets the columns involved in this constraint.- Specified by:
getColumnsin interfaceIConstraint- Returns:
- a collection of column names
-
containsColumn
Description copied from interface:IConstraintChecks if this constraint involves the specified column.- Specified by:
containsColumnin interfaceIConstraint- Parameters:
name- the column name to check- Returns:
- true if the column is part of this constraint
-
setPrimaryKey
public void setPrimaryKey(boolean isPrimaryKey) -
addColumn
Adds a column to this constraint.- Parameters:
column- the column name to add
-
getContainingSchema
Returns the containing schema of this constraint. This operation is not supported for metadata constraints.- Specified by:
getContainingSchemain interfaceISearchPath- Specified by:
getContainingSchemain interfaceISubElement- Returns:
- never returns normally
- Throws:
IllegalStateException- always thrown as this operation is unsupported
-
getSchemaName
Returns the schema name of this constraint.- Specified by:
getSchemaNamein interfaceISearchPath- Returns:
- the schema name
-
getTableName
Returns the table name of this constraint.- Specified by:
getTableNamein interfaceIConstraint- Returns:
- the table name
-
getDefinition
Returns the constraint definition. This operation is not supported for metadata constraints.- Specified by:
getDefinitionin interfaceIConstraint- Returns:
- never returns normally
- Throws:
IllegalStateException- always thrown as this operation is unsupported
-
isClustered
public boolean isClustered()Description copied from interface:IConstraintPkChecks if this primary key constraint is clustered.- Specified by:
isClusteredin interfaceIConstraintPk- Returns:
- true if the primary key is clustered
-