Class MsAbstractCommonFunction
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsAbstractStatement
org.pgcodekeeper.core.database.ms.schema.MsAbstractCommonFunction
- All Implemented Interfaces:
IFunction,ISearchPath,IStatement,IHashable
- Direct Known Subclasses:
MsAbstractClrFunction,MsAbstractFunction
Abstract base class for database functions, procedures, and aggregates.
Provides common functionality for callable database objects across different database types.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(Argument argument) Adds an argument to this function.appendAlterSQL(IStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleanChecks if this statement can be dropped before being recreated.booleancompare(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.Getter forarguments.voidgetCreationSQL(SQLScript script) Generates the SQL statements needed to create this database object.Gets the return type of this function.Gets the return columns for table-valued functions.voidsetReturns(String returns) Sets the return type of this function.Methods inherited from class org.pgcodekeeper.core.database.ms.schema.MsAbstractStatement
appendOwnerSQL, formatSql, getQuoter, getRenameCommand, getSeparator, isOwnedMethods inherited from class org.pgcodekeeper.core.database.base.schema.AbstractStatement
addDependency, addPrivilege, appendAlterComments, appendComments, appendPrivileges, canDrop, checkComments, clearPrivileges, compareChildren, deepCopy, equals, fillChildrenList, fillDescendantsList, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, 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, clearPrivileges, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getOwner, getParent, getPrivileges, getQualifiedName, getQuotedName, getQuoter, getRenameCommand, getSeparator, getSQL, getStatementType, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopy
-
Method Details
-
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
-
getReturns
Description copied from interface:IFunctionGets the return type of this function.- Specified by:
getReturnsin interfaceIFunction- Returns:
- the return type, or null if not applicable
-
canDropBeforeCreate
public boolean canDropBeforeCreate()Description copied from interface:IStatementChecks if this statement can be dropped before being recreated. Override in subclasses that support drop-before-create behavior.- Specified by:
canDropBeforeCreatein interfaceIStatement- Overrides:
canDropBeforeCreatein classAbstractStatement- Returns:
- true if the statement can be dropped before recreation
-
setReturns
Description copied from interface:IFunctionSets the return type of this function.- Specified by:
setReturnsin interfaceIFunction- Parameters:
returns- the return type to set
-
getReturnsColumns
Description copied from interface:IFunctionGets the return columns for table-valued functions.- Specified by:
getReturnsColumnsin interfaceIFunction- Returns:
- a map of column names to their types
-
getArguments
Getter forarguments. List cannot be modified.- Specified by:
getArgumentsin interfaceIFunction- Returns:
- the list of arguments
-
addArgument
Adds an argument to this function.- Parameters:
argument- the argument to add
-
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
-