Class PgOperator
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgAbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgOperator
- All Implemented Interfaces:
IOperator,ISearchPath,IStatement,IHashable
PostgreSQL operator implementation.
Operators are symbols that represent specific operations (like +, -, *, etc.)
and can be customized for user-defined types with associated functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendAlterSQL(IStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleancompare(IStatement obj) This method does not account for nested child PgStatements.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.Returns the operator arguments in parentheses format.voidgetCreationSQL(SQLScript script) Generates the SQL statements needed to create this database object.Gets the left argument type of this operator.getName()Alias forgetSignature()which provides a unique operator ID.Gets the fully qualified name of this statement.Gets the return type of this operator.Gets the right argument type of this operator.Returns the operator signature including its arguments.Gets the type of this database object.voidsetCommutator(String commutator) voidsetHashes(boolean isHashes) voidvoidsetLeftArg(String leftArg) voidsetMerges(boolean isMerges) voidsetNegator(String negator) voidsetProcedure(String procedure) voidsetRestrict(String restrict) voidsetReturns(String returns) Sets the return type of this operator.voidsetRightArg(String rightArg) 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, compareChildren, deepCopy, equals, fillChildrenList, fillDescendantsList, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getSeparator, getSQL, getTwin, hasChildren, hashCode, isLib, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, shallowCopy, toStringMethods 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, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getOwner, getParent, getPrivileges, getQuotedName, getQuoter, getRenameCommand, getSeparator, getSQL, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopy
-
Constructor Details
-
PgOperator
Creates a new PostgreSQL operator.- Parameters:
name- operator symbol
-
-
Method Details
-
getStatementType
Description copied from interface:IStatementGets the type of this database object.- Specified by:
getStatementTypein interfaceIStatement- Returns:
- the database object type
-
getCreationSQL
Description copied from interface:IStatementGenerates 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:
getCreationSQLin interfaceIStatement- Parameters:
script- the SQL script to append creation statements to
-
appendAlterSQL
Description copied from interface:IStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin interfaceIStatement- Parameters:
newCondition- new object statescript- script to collect changes- Returns:
- object change type
-
setReturns
Description copied from interface:IOperatorSets the return type of this operator.- Specified by:
setReturnsin interfaceIOperator- Parameters:
returns- the return type to set
-
getReturns
Description copied from interface:IOperatorGets the return type of this operator.- Specified by:
getReturnsin interfaceIOperator- Returns:
- the return type
-
getSignature
Returns the operator signature including its arguments.- Returns:
- operator signature in format "op(leftarg, rightarg)"
-
getArguments
Returns the operator arguments in parentheses format.- Returns:
- arguments string in format "(leftarg, rightarg)" or "(rightarg)" for unary
-
getName
Alias forgetSignature()which provides a unique operator ID.Use
AbstractStatement.getBareName()to get just the operator name.- Specified by:
getNamein interfaceIStatement- Overrides:
getNamein classAbstractStatement- Returns:
- the statement name
-
getQualifiedName
Description copied from interface:IStatementGets the fully qualified name of this statement.- Specified by:
getQualifiedNamein interfaceIStatement- Overrides:
getQualifiedNamein classAbstractStatement- Returns:
- fully qualified (up to schema) dot-delimited object name. Identifiers are quoted.
-
setProcedure
-
getLeftArg
Description copied from interface:IOperatorGets the left argument type of this operator.- Specified by:
getLeftArgin interfaceIOperator- Returns:
- the left argument type
-
setLeftArg
-
getRightArg
Description copied from interface:IOperatorGets the right argument type of this operator.- Specified by:
getRightArgin interfaceIOperator- Returns:
- the right argument type
-
setRightArg
-
setCommutator
-
setNegator
-
setMerges
public void setMerges(boolean isMerges) -
setHashes
public void setHashes(boolean isHashes) -
setRestrict
-
setJoin
-
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- Parameters:
hasher- the hasher instance to use for hash computation
-
compare
Description copied from class:AbstractStatementThis method does not account for nested child PgStatements. Shallow version ofAbstractStatement.equals(Object)- Specified by:
comparein interfaceIStatement- Overrides:
comparein classAbstractStatement
-