Package org.apache.torque.util.functions
Klasse AbstractFunction
java.lang.Object
org.apache.torque.util.functions.AbstractFunction
- Alle implementierten Schnittstellen:
Column
,SQLFunction
A default framework that implements the core SQLFunction interface
requirements that can be used to build specific functions on.
- Version:
- $Id: AbstractFunction.java 1879896 2020-07-15 15:03:46Z gk $
- Autor:
- Greg Monroe
-
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotected
Functions should only be created via the FunctionFactory class. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
addArgument
(Object arg) Add an argument to the function argument listgetArgument
(int index) Return the object representation of the function parameter at the specified index.Get the full list of function argumentsObject[]
Return all the parameters as an object array.Returns the column to which this function is applied.Returns the column name.Returns the table name prefixed with the schema name if it exists from the function argument(s).Returns the name of any fixed schema prefix for the column's table (if any) from the function argument(s).abstract String
This should return the SQL string that can be used when constructing the query.Returns the name of the associated table (not prefixed by the schema name) from the function argument(s).protected void
setArgumentList
(List<Object> args) Set the full function argument list.void
setArguments
(Object... args) Sets the function arguments.
-
Konstruktordetails
-
AbstractFunction
protected AbstractFunction()Functions should only be created via the FunctionFactory class.
-
-
Methodendetails
-
getSqlExpression
This should return the SQL string that can be used when constructing the query. E.g. "AVG( table.column )" or CONCAT(table.column, " foobar");- Angegeben von:
getSqlExpression
in SchnittstelleColumn
- Gibt zurück:
- The SQL String.
-
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.- Angegeben von:
getArguments
in SchnittstelleSQLFunction
- Gibt zurück:
- 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 arguments.- Angegeben von:
setArguments
in SchnittstelleSQLFunction
- Parameter:
args
- the function arguments, not null.
-
getColumn
Returns the column to which this function is applied.- Angegeben von:
getColumn
in SchnittstelleSQLFunction
- Gibt zurück:
- the column, not null.
- Löst aus:
IllegalStateException
- if the column cannot be determined.
-
getArgument
Return the object representation of the function parameter at the specified index. Will be null if parameter does not exist.- Angegeben von:
getArgument
in SchnittstelleSQLFunction
- Parameter:
index
- The 0 based index of the parameter to get.- Gibt zurück:
- The parameter object. Null if one does not exist.
-
addArgument
Add an argument to the function argument list- Parameter:
arg
- The argument object.
-
setArgumentList
Set the full function argument list.- Parameter:
args
- The new argument list
-
getArgumentList
Get the full list of function arguments- Gibt zurück:
- The argument list
-
getColumnName
Returns the column name. This implementation always return null because we do not reference a real column.- Angegeben von:
getColumnName
in SchnittstelleColumn
- Gibt zurück:
- the column name, always null.
-
getTableName
Returns the name of the associated table (not prefixed by the schema name) from the function argument(s). In case that no unique table name can be determined, null is returned.- Angegeben von:
getTableName
in SchnittstelleColumn
- Gibt zurück:
- the name of the table, may be null but not blank.
-
getSchemaName
Returns the name of any fixed schema prefix for the column's table (if any) from the function argument(s). In case that no unique schema can be determined, null is returned.- Angegeben von:
getSchemaName
in SchnittstelleColumn
- Gibt zurück:
- the schema name, or null if the schema is not known.
-
getFullTableName
Returns the table name prefixed with the schema name if it exists from the function argument(s). I.e. if a schema name exists, the result will be schemaName.tableName, and otherwise it will just be tableName. In case that no unique full table can be determined, null is returned.- Angegeben von:
getFullTableName
in SchnittstelleColumn
- Gibt zurück:
- the fully qualified table name may be null but not blank.
-