|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.util.functions.FunctionFactory
public class FunctionFactory
This class is a "Factory class" for creating SQLFunction implementation classes. It works with the DB adaptor classes to create functions that are appropriate for the specified (or default) db server type.
The generic method for doing this is the functionInstance(String, FunctionEnum, Object[]) method. However, there are a variety of convenience methods that can be used to quickly created specific functions, e.g. avg( Object ) and the like.
SQLFunction
,
SummaryHelper
Method Summary | |
---|---|
static SQLFunction |
avg(java.lang.Object expr1)
Convenience method for creating a non-distinct function that uses the default DB. |
static SQLFunction |
avg(java.lang.String dbName,
java.lang.Object expr1,
boolean distinct)
Create an AVG SQL function implementation. |
static SQLFunction |
count(java.lang.Object expr1)
Convenience method for creating a non-distinct function that uses the default DB. |
static SQLFunction |
count(java.lang.String dbName,
java.lang.Object expr1,
boolean distinct)
Create a COUNT SQL function implementation. |
static SQLFunction |
functionInstance(FunctionEnum function,
java.lang.Object[] arguments)
|
static SQLFunction |
functionInstance(java.lang.String dbName,
FunctionEnum function,
java.lang.Object[] arguments)
"Generic" function class creation method. |
static SQLFunction |
max(java.lang.Object expr1)
Convenience method for creating a non-distinct function that uses the default DB. |
static SQLFunction |
max(java.lang.String dbName,
java.lang.Object expr1,
boolean distinct)
Create a MAX SQL function implementation. |
static SQLFunction |
min(java.lang.Object expr1)
Convenience method for creating a non-distinct function that uses the default DB. |
static SQLFunction |
min(java.lang.String dbName,
java.lang.Object expr1,
boolean distinct)
Create a MIN SQL function implementation. |
static SQLFunction |
sum(java.lang.Object expr1)
Convenience method for creating a non-distinct function that uses the default DB. |
static SQLFunction |
sum(java.lang.String dbName,
java.lang.Object expr1,
boolean distinct)
Create a SUM SQL function implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final SQLFunction avg(java.lang.String dbName, java.lang.Object expr1, boolean distinct) throws java.lang.Exception
dbName
- The name of the Torque dbexpr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.distinct
- If true, the function expr will have be prefaced
with "DISTINCT", e.g. function(DISTINCT column).
java.lang.Exception
public static final SQLFunction avg(java.lang.Object expr1) throws java.lang.Exception
expr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.
java.lang.Exception
public static final SQLFunction count(java.lang.String dbName, java.lang.Object expr1, boolean distinct) throws java.lang.Exception
dbName
- The name of the Torque dbexpr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.distinct
- If true, the function expr will have be prefaced
with "DISTINCT", e.g. function(DISTINCT column).
java.lang.Exception
public static final SQLFunction count(java.lang.Object expr1) throws java.lang.Exception
expr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.
java.lang.Exception
public static final SQLFunction max(java.lang.String dbName, java.lang.Object expr1, boolean distinct) throws java.lang.Exception
dbName
- The name of the Torque dbexpr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.distinct
- If true, the function expr will have be prefaced
with "DISTINCT", e.g. function(DISTINCT column).
java.lang.Exception
public static final SQLFunction max(java.lang.Object expr1) throws java.lang.Exception
expr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.
java.lang.Exception
public static final SQLFunction min(java.lang.String dbName, java.lang.Object expr1, boolean distinct) throws java.lang.Exception
dbName
- The name of the Torque dbexpr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.distinct
- If true, the function expr will have be prefaced
with "DISTINCT", e.g. function(DISTINCT column).
java.lang.Exception
public static final SQLFunction min(java.lang.Object expr1) throws java.lang.Exception
expr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.
java.lang.Exception
public static final SQLFunction sum(java.lang.String dbName, java.lang.Object expr1, boolean distinct) throws java.lang.Exception
dbName
- The name of the Torque dbexpr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.distinct
- If true, the function expr will have be prefaced
with "DISTINCT", e.g. function(DISTINCT column).
java.lang.Exception
public static final SQLFunction sum(java.lang.Object expr1) throws java.lang.Exception
expr1
- The expression to apply the function to. Generally a
column name in table.column format. It is assumed
that the "toString()" method of this object will be
acceptable for an argument.
java.lang.Exception
public static final SQLFunction functionInstance(java.lang.String dbName, FunctionEnum function, java.lang.Object[] arguments) throws java.lang.Exception
dbName
- The name of the Torque DB this function applies to or
the default Torque DB if null.function
- The function to create an object for.arguments
- The arguments required by the function object.
java.lang.Exception
public static final SQLFunction functionInstance(FunctionEnum function, java.lang.Object[] arguments) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |