Class PgConstraintExclude
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgAbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgConstraint
org.pgcodekeeper.core.database.pg.schema.PgConstraintExclude
- All Implemented Interfaces:
IConstraint,ISearchPath,ISimpleColumnContainer,IStatement,ISubElement,PgIndexParamContainer,IHashable
public class PgConstraintExclude
extends PgConstraint
implements PgIndexParamContainer, ISimpleColumnContainer
PostgreSQL EXCLUDE constraint implementation.
EXCLUDE constraints ensure that if any two rows are compared on specified columns
using specified operators, not all comparisons will return TRUE.
-
Constructor Summary
ConstructorsConstructorDescriptionPgConstraintExclude(String name) Creates a new PostgreSQL EXCLUDE constraint. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(SimpleColumn column) Adds a column reference to this container.voidaddInclude(String include) Adds a column to the INCLUDE clause of the index.voidAdds an index parameter (WITH clause option).booleancompare(IStatement obj) This method does not account for nested child PgStatements.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.booleancontainsColumn(String name) Checks if this constraint involves the specified column.Gets the columns involved in this constraint.Gets the SQL definition of this constraint.voidsetIndexMethod(String indexMethod) voidsetPredicate(String predicate) voidsetTablespace(String tablespace) Sets the tablespace for this index.Methods inherited from class org.pgcodekeeper.core.database.pg.schema.PgConstraint
appendAlterSQL, appendOptions, getCreationSQL, getDropSQL, getTableName, isNotValid, setDeferrable, setInitially, setNotEnforced, setNotValidMethods inherited from class org.pgcodekeeper.core.database.pg.schema.PgAbstractStatement
addPrivilege, appendDefaultPrivileges, appendOwnerSQL, formatSql, getQuoter, getRenameCommand, isOwnedMethods inherited from class org.pgcodekeeper.core.database.base.schema.AbstractStatement
addDependency, appendAlterComments, appendComments, appendPrivileges, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, fillChildrenList, fillDescendantsList, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSeparator, getSQL, getTwin, hasChildren, hashCode, isLib, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, shallowCopy, toStringMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IConstraint
getStatementType, isPrimaryKeyMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendAlterSQL, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, 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
getContainingSchema, toObjectReference
-
Constructor Details
-
PgConstraintExclude
Creates a new PostgreSQL EXCLUDE constraint.- Parameters:
name- constraint name
-
-
Method Details
-
getDefinition
Description copied from interface:IConstraintGets the SQL definition of this constraint.- Specified by:
getDefinitionin interfaceIConstraint- Returns:
- the constraint definition
-
getErrorCode
-
addInclude
Description copied from interface:PgIndexParamContainerAdds a column to the INCLUDE clause of the index.- Specified by:
addIncludein interfaceISimpleColumnContainer- Specified by:
addIncludein interfacePgIndexParamContainer- Parameters:
include- column name to include
-
getColumns
Description copied from interface:IConstraintGets the columns involved in this constraint.- Specified by:
getColumnsin interfaceIConstraint- Overrides:
getColumnsin classPgConstraint- Returns:
- a collection of column names
-
containsColumn
Description copied from interface:IConstraintChecks if this constraint involves the specified column.- Specified by:
containsColumnin interfaceIConstraint- Overrides:
containsColumnin classPgConstraint- Parameters:
name- the column name to check- Returns:
- true if the column is part of this constraint
-
addColumn
Description copied from interface:ISimpleColumnContainerAdds a column reference to this container.- Specified by:
addColumnin interfaceISimpleColumnContainer- Parameters:
column- the simple column to add
-
addParam
Description copied from interface:PgIndexParamContainerAdds an index parameter (WITH clause option).- Specified by:
addParamin interfacePgIndexParamContainer- Parameters:
key- parameter namevalue- parameter value
-
setIndexMethod
-
setPredicate
-
setTablespace
Description copied from interface:PgIndexParamContainerSets the tablespace for this index.- Specified by:
setTablespacein interfacePgIndexParamContainer- Parameters:
tablespace- tablespace name
-
computeHash
Description copied from interface:IHashableComputes the hash of the implementing object using the provided hasher. The implementation should call appropriateputmethods on the hasher for all fields that should contribute to the hash value.- Specified by:
computeHashin interfaceIHashable- Overrides:
computeHashin classPgConstraint- Parameters:
hasher- the hasher instance to use for hash computation
-
compare
Description copied from class:AbstractStatementThis method does not account for nested child PgStatements. Shallow version ofAbstractStatement.equals(Object)- Specified by:
comparein interfaceIStatement- Overrides:
comparein classPgConstraint
-