Class AbstractPolicy

java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractPolicy
All Implemented Interfaces:
IHashable, IStatement
Direct Known Subclasses:
ChPolicy, PgPolicy

public abstract class AbstractPolicy extends PgStatement
Abstract base class for database row-level security policies. Provides common functionality for policies that control access to table rows based on events, roles, and conditions.
  • Method Details

    • getStatementType

      public DbObjType getStatementType()
      Description copied from interface: IStatement
      Gets the type of this database object.
      Returns:
      the database object type
    • setEvent

      public void setEvent(EventType event)
    • addRole

      public void addRole(String role)
      Adds a role to this policy.
      Parameters:
      role - the role name to add
    • setUsing

      public void setUsing(String using)
    • setPermissive

      public void setPermissive(boolean isPermissive)
    • shallowCopy

      public AbstractPolicy shallowCopy()
      Description copied from class: PgStatement
      Copies all object properties into a new object and leaves all its children empty.
      Specified by:
      shallowCopy in class PgStatement
      Returns:
      shallow copy of a DB object.
    • computeHash

      public void computeHash(Hasher hasher)
      Description copied from interface: IHashable
      Computes the hash of the implementing object using the provided hasher. The implementation should call appropriate put methods on the hasher for all fields that should contribute to the hash value.
      Parameters:
      hasher - the hasher instance to use for hash computation
    • compare

      public boolean compare(PgStatement obj)
      Description copied from class: PgStatement
      This method does not account for nested child PgStatements. Shallow version of PgStatement.equals(Object)
      Overrides:
      compare in class PgStatement