Class 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 Details

    • fillChildrenList

      public void fillChildrenList(List<Collection<? extends AbstractStatement>> l)
      Overrides:
      fillChildrenList in class AbstractStatement
    • getChild

      public AbstractStatement getChild(String name, DbObjType type)
      Description copied from interface: IStatementContainer
      Gets a child statement by name and type.
      Specified by:
      getChild in interface IStatementContainer
      Parameters:
      name - the name of the child to find
      type - the type of the child to find
      Returns:
      the child statement, or null if not found
    • getChildrenByType

      public Collection<IStatement> getChildrenByType(DbObjType type)
      Description copied from interface: IStatementContainer
      get all children by type
      Specified by:
      getChildrenByType in interface IStatementContainer
      Parameters:
      type - the type of the children
      Returns:
      unmodifiable collection of child statement, or empty list
    • addChild

      public void addChild(IStatement st)
      Description copied from interface: IStatementContainer
      Adds a child statement to this container.
      Specified by:
      addChild in interface IStatementContainer
      Parameters:
      st - the child statement to add
    • isClustered

      public boolean isClustered()
      Checks if this container has any clustered indexes or constraints.
    • getIndex

      public PgIndex getIndex(String name)
      Finds index according to specified index name.
      Parameters:
      name - name of the index to be searched
      Returns:
      found index or null if no such index has been found
    • getTrigger

      public PgTrigger getTrigger(String name)
      Finds trigger according to specified trigger name.
      Parameters:
      name - name of the trigger to be searched
      Returns:
      found trigger or null if no such trigger has been found
    • getRule

      public PgRule getRule(String name)
      Finds rule according to specified rule name.
      Parameters:
      name - name of the rule to be searched
      Returns:
      found rule or null if no such rule has been found
    • getPolicy

      public PgPolicy getPolicy(String name)
      Finds policy according to specified policy name.
      Parameters:
      name - name of the policy to be searched
      Returns:
      found policy or null if no such policy has been found
    • getConstraints

      public abstract Collection<IConstraint> getConstraints()
    • getIndexes

      public Collection<PgIndex> getIndexes()
      Getter for indexes. The list cannot be modified.
      Returns:
      indexes
    • getTriggers

      public Collection<PgTrigger> getTriggers()
      Getter for triggers. The list cannot be modified.
      Returns:
      triggers
    • getPolicies

      public Collection<PgPolicy> getPolicies()
      Getter for policies. The list cannot be modified.
      Returns:
      policies
    • computeChildrenHash

      public void computeChildrenHash(Hasher hasher)
    • compareChildren

      public boolean compareChildren(AbstractStatement obj)
      Description copied from class: AbstractStatement
      Deep part of AbstractStatement.equals(Object). Compares all object's child PgStatements for equality.
      Overrides:
      compareChildren in class AbstractStatement