Package org.pgcodekeeper.core.schema.pg
Class PgOperator
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.pg.PgOperator
- All Implemented Interfaces:
IHashable,IOperator,ISearchPath,IStatement
PostgreSQL operator implementation.
Operators are symbols that represent specific operations (like +, -, *, etc.)
and can be customized for user-defined types with associated functions.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendAlterSQL(PgStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleancompare(PgStatement 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.Gets the schema that contains this object.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) Copies all object properties into a new object and leaves all its children empty.Methods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDbType, getDeps, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, isSubElement, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getParent
-
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
-
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
-
getCreationSQL
Description copied from class:PgStatementGenerates 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 classPgStatement- Parameters:
script- the SQL script to append creation statements to
-
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
-
appendAlterSQL
Description copied from class:PgStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin classPgStatement- Parameters:
newCondition- new object statescript- script to collect changes- Returns:
- object change type
-
getName
Alias forgetSignature()which provides a unique operator ID.Use
PgStatement.getBareName()to get just the operator name.- Specified by:
getNamein interfaceIStatement- Overrides:
getNamein classPgStatement- Returns:
- the statement name
-
getQualifiedName
Description copied from interface:IStatementGets the fully qualified name of this statement.- Specified by:
getQualifiedNamein interfaceIStatement- Overrides:
getQualifiedNamein classPgStatement- Returns:
- fully qualified (up to schema) dot-delimited object name. Identifiers are quoted.
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classPgStatement
-
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
-
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
-
shallowCopy
Description copied from class:PgStatementCopies all object properties into a new object and leaves all its children empty.- Specified by:
shallowCopyin classPgStatement- Returns:
- shallow copy of a DB object.
-
getContainingSchema
Description copied from interface:ISearchPathGets the schema that contains this object.- Specified by:
getContainingSchemain interfaceISearchPath- Returns:
- the containing schema
-