Class PgOperator

java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.pg.PgOperator
All Implemented Interfaces:
IHashable, IOperator, ISearchPath, IStatement

public final class PgOperator extends PgStatement implements IOperator, ISearchPath
PostgreSQL operator implementation. Operators are symbols that represent specific operations (like +, -, *, etc.) and can be customized for user-defined types with associated functions.
  • Constructor Details

    • PgOperator

      public PgOperator(String name)
      Creates a new PostgreSQL operator.
      Parameters:
      name - operator symbol
  • Method Details

    • getStatementType

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

      public void setReturns(String returns)
      Description copied from interface: IOperator
      Sets the return type of this operator.
      Specified by:
      setReturns in interface IOperator
      Parameters:
      returns - the return type to set
    • getReturns

      public String getReturns()
      Description copied from interface: IOperator
      Gets the return type of this operator.
      Specified by:
      getReturns in interface IOperator
      Returns:
      the return type
    • getCreationSQL

      public void getCreationSQL(SQLScript script)
      Description copied from class: PgStatement
      Generates the SQL statements needed to create this database object. This is an abstract method that must be implemented by subclasses to provide the specific CREATE SQL for each object type.
      Specified by:
      getCreationSQL in class PgStatement
      Parameters:
      script - the SQL script to append creation statements to
    • getSignature

      public String getSignature()
      Returns the operator signature including its arguments.
      Returns:
      operator signature in format "op(leftarg, rightarg)"
    • getArguments

      public String getArguments()
      Returns the operator arguments in parentheses format.
      Returns:
      arguments string in format "(leftarg, rightarg)" or "(rightarg)" for unary
    • appendAlterSQL

      public ObjectState appendAlterSQL(PgStatement newCondition, SQLScript script)
      Description copied from class: PgStatement
      Fill script with object changes and return change type
      Specified by:
      appendAlterSQL in class PgStatement
      Parameters:
      newCondition - new object state
      script - script to collect changes
      Returns:
      object change type
    • getName

      public String getName()
      Alias for getSignature() which provides a unique operator ID.

      Use PgStatement.getBareName() to get just the operator name.

      Specified by:
      getName in interface IStatement
      Overrides:
      getName in class PgStatement
      Returns:
      the statement name
    • getQualifiedName

      public String getQualifiedName()
      Description copied from interface: IStatement
      Gets the fully qualified name of this statement.
      Specified by:
      getQualifiedName in interface IStatement
      Overrides:
      getQualifiedName in class PgStatement
      Returns:
      fully qualified (up to schema) dot-delimited object name. Identifiers are quoted.
    • 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
    • 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.
      Specified by:
      computeHash in interface IHashable
      Parameters:
      hasher - the hasher instance to use for hash computation
    • setProcedure

      public void setProcedure(String procedure)
    • getLeftArg

      public String getLeftArg()
      Description copied from interface: IOperator
      Gets the left argument type of this operator.
      Specified by:
      getLeftArg in interface IOperator
      Returns:
      the left argument type
    • setLeftArg

      public void setLeftArg(String leftArg)
    • getRightArg

      public String getRightArg()
      Description copied from interface: IOperator
      Gets the right argument type of this operator.
      Specified by:
      getRightArg in interface IOperator
      Returns:
      the right argument type
    • setRightArg

      public void setRightArg(String rightArg)
    • setCommutator

      public void setCommutator(String commutator)
    • setNegator

      public void setNegator(String negator)
    • setMerges

      public void setMerges(boolean isMerges)
    • setHashes

      public void setHashes(boolean isHashes)
    • setRestrict

      public void setRestrict(String restrict)
    • setJoin

      public void setJoin(String join)
    • shallowCopy

      public PgOperator 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.
    • getContainingSchema

      public AbstractSchema getContainingSchema()
      Description copied from interface: ISearchPath
      Gets the schema that contains this object.
      Specified by:
      getContainingSchema in interface ISearchPath
      Returns:
      the containing schema