org.apache.torque.util.functions
Interface SQLFunction

All Superinterfaces:
Column
All Known Implementing Classes:
AbstractFunction, AggregateFunction, Avg, Count, Max, Min, Sum

public interface SQLFunction
extends Column

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 1448414 2013-02-20 21:06:35Z tfischer $
Author:
Greg Monroe

Method Summary
 Object getArgument(int i)
          Returns the function parameters at index i.
 Object[] getArguments()
          Return all the parameters as an object array.
 Column getColumn()
          Returns the column to which this function is applied.
 void setArguments(Object[] args)
          Sets the function specific arguments.
 
Methods inherited from interface org.apache.torque.Column
getColumnName, getFullTableName, getSchemaName, getSqlExpression, getTableName
 

Method Detail

getArgument

Object getArgument(int i)
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

void setArguments(Object[] args)
Sets the function specific arguments. Note, this should generally only be called by FunctionFactory.

Parameters:
args - The function specific arguments.


Copyright © 2000-2013 The Apache Software Foundation. All Rights Reserved.