Package org.apache.torque.util.functions
Interface SQLFunction
- All Superinterfaces:
Column
- All Known Implementing Classes:
AbstractFunction,AggregateFunction,Avg,Count,Max,Min,Sum
Define the basic methods that classes that support SQL Functions
need to implement for Classes that use them. This is intended to
allow code to be written before functions are fully integrated
with the DBAdaptors. As well as allowing for functions to
expand as needed.
- Version:
- $Id: SQLFunction.java 1855244 2019-03-11 15:59:16Z tv $
- Author:
- Greg Monroe
-
Method Summary
Modifier and TypeMethodDescriptiongetArgument(int i) Returns the function parameters at index i.Object[]Return all the parameters as an object array.Returns the column to which this function is applied.voidsetArguments(Object... args) Sets the function specific arguments.Methods inherited from interface org.apache.torque.Column
getColumnName, getFullTableName, getSchemaName, getSqlExpression, getTableName
-
Method Details
-
getArgument
Returns the function parameters at index i. Should be null if parameter does not exist.- Parameters:
i- The 0 based parameter to get.- Returns:
- The parameter. Null if one does not exist.
-
getColumn
Column getColumn()Returns the column to which this function is applied.- Returns:
- the column, not null.
- Throws:
IllegalStateException- if the column cannot be determined.
-
getArguments
Object[] getArguments()Return all the parameters as an object array. This allow for processing of the parameters in their original format rather than just in String format. E.g. a parameter might be specified as a Date object, or a Column object.- Returns:
- Should return a valid Object array and not null. E.g. implementors should return new Object[0] if there are no parameters.
-
setArguments
Sets the function specific arguments. Note, this should generally only be called by FunctionFactory.- Parameters:
args- The function specific arguments.
-