Class PgAbstractStatementContainer
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgAbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgAbstractStatementContainer
- All Implemented Interfaces:
IRelation,ISearchPath,IStatement,IStatementContainer,IHashable
- Direct Known Subclasses:
PgAbstractTable,PgAbstractView
public abstract class PgAbstractStatementContainer
extends PgAbstractStatement
implements IRelation, IStatementContainer, ISearchPath
Abstract base class for database objects that can contain other statements.
Provides common functionality for containers like tables and views that can have
indexes, triggers, rules, policies, and constraints as child objects.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(IStatement st) Adds a child statement to this container.booleanDeep part ofAbstractStatement.equals(Object).voidcomputeChildrenHash(Hasher hasher) voidfillChildrenList(List<Collection<? extends AbstractStatement>> l) Gets a child statement by name and type.getChildrenByType(DbObjType type) get all children by typeabstract Collection<IConstraint>Finds index according to specified indexname.Getter forindexes.Getter forpolicies.Finds policy according to specified policyname.Finds rule according to specified rulename.getTrigger(String name) Finds trigger according to specified triggername.Getter fortriggers.booleanChecks if this container has any clustered indexes or constraints.Methods 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, compare, deepCopy, equals, fillDescendantsList, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, 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.hasher.IHashable
computeHashMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IRelation
getRelationColumnsMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getContainingSchema, getDatabase, getSchemaName, toObjectReferenceMethods 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, getStatementType, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopy
-
Method Details
-
fillChildrenList
- Overrides:
fillChildrenListin classAbstractStatement
-
getChild
Description copied from interface:IStatementContainerGets a child statement by name and type.- Specified by:
getChildin interfaceIStatementContainer- Parameters:
name- the name of the child to findtype- the type of the child to find- Returns:
- the child statement, or null if not found
-
getChildrenByType
Description copied from interface:IStatementContainerget all children by type- Specified by:
getChildrenByTypein interfaceIStatementContainer- Parameters:
type- the type of the children- Returns:
- unmodifiable collection of child statement, or empty list
-
addChild
Description copied from interface:IStatementContainerAdds a child statement to this container.- Specified by:
addChildin interfaceIStatementContainer- Parameters:
st- the child statement to add
-
isClustered
public boolean isClustered()Checks if this container has any clustered indexes or constraints. -
getIndex
Finds index according to specified indexname.- Parameters:
name- name of the index to be searched- Returns:
- found index or null if no such index has been found
-
getTrigger
Finds trigger according to specified triggername.- Parameters:
name- name of the trigger to be searched- Returns:
- found trigger or null if no such trigger has been found
-
getRule
Finds rule according to specified rulename.- Parameters:
name- name of the rule to be searched- Returns:
- found rule or null if no such rule has been found
-
getPolicy
Finds policy according to specified policyname.- Parameters:
name- name of the policy to be searched- Returns:
- found policy or null if no such policy has been found
-
getConstraints
-
getIndexes
Getter forindexes. The list cannot be modified.- Returns:
indexes
-
getTriggers
Getter fortriggers. The list cannot be modified.- Returns:
triggers
-
getPolicies
Getter forpolicies. The list cannot be modified.- Returns:
policies
-
computeChildrenHash
-
compareChildren
Description copied from class:AbstractStatementDeep part ofAbstractStatement.equals(Object). Compares all object's child PgStatements for equality.- Overrides:
compareChildrenin classAbstractStatement
-