Package org.pgcodekeeper.core.schema.pg
Class PgConstraintExclude
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractConstraint
org.pgcodekeeper.core.schema.pg.PgConstraint
org.pgcodekeeper.core.schema.pg.PgConstraintExclude
- All Implemented Interfaces:
IHashable,IConstraint,ISearchPath,ISimpleColumnContainer,IStatement,PgIndexParamContainer
public final 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.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
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(PgStatement 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.schema.pg.PgConstraint
appendAlterSQL, getCreationSQL, getDropSQL, setDeferrable, setInitially, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.AbstractConstraint
getContainingSchema, getLocation, getStatementType, getTableName, isNotValid, isSubElement, setNotValidMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDbType, getDeps, getDescendants, getDropSQL, getLibName, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.IConstraint
isPrimaryKeyMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName
-
Constructor Details
-
PgConstraintExclude
Creates a new PostgreSQL EXCLUDE constraint.- Parameters:
name- constraint name
-
-
Method Details
-
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 classAbstractConstraint- 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 classAbstractConstraint- 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
-
getDefinition
Description copied from interface:IConstraintGets the SQL definition of this constraint.- Specified by:
getDefinitionin interfaceIConstraint- Returns:
- the constraint definition
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classPgConstraint
-
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
-
getErrorCode
-