|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.query.SQLFunction
This class represents a SQL function within a SQL statement. Zero or
more function arguments are supported.
Supported API: true
Extendable: false
Nested Class Summary | |
(package private) static class |
SQLFunction.Info
|
Field Summary | |
static String |
ABS
Supported API: true |
static String |
ADD
Supported API: true |
private boolean |
advancedQueryEnabled
|
private boolean |
aggregate
|
private Vector |
arguments
|
static String |
AVERAGE
Supported API: true |
static String |
BITAND
Supported API: true |
static String |
CEIL
Supported API: true |
private static String |
CLASSNAME
|
private String |
columnAlias
|
static String |
CONCAT
Supported API: true |
static String |
COUNT
Supported API: true |
static Object |
DATE_SQL_FORMAT
|
static String |
DAY_FMT
|
static boolean |
DEBUG
|
private static DebugWriter |
DEBUG_LOG
|
static String |
DECODE
Supported API: true |
static String |
DIVIDE
Supported API: true |
private static DMLGenerator |
dmlGenerator
|
static long |
EXTERNALIZATION_VERSION_UID
|
static String |
FLOOR
Supported API: true |
static String |
GET_DAY
Supported API: true |
static String |
GET_HOURS
Supported API: true |
static String |
GET_MINUTES
Supported API: true |
static String |
GET_MONTH
Supported API: true |
static String |
GET_SECONDS
Supported API: true |
static String |
GET_YEAR
Supported API: true |
static String |
HOUR_FMT
|
static int |
HOUR_PER_DAY
|
static String |
IN_STRING
Supported API: true |
private static Hashtable |
INFO_MAP
|
static String |
LENGTH
Supported API: false |
static String |
LOG
Supported API: true |
static String |
LOWER
Supported API: true |
static String |
LTRIM
Supported API: true |
static String |
MATCH_NUMBER
|
static String |
MATCH_STRING
|
static String |
MATCH_TIMESTAMP
|
static String |
MAXIMUM
Supported API: true |
private int |
maximumArgumentCount
|
static String |
MINIMUM
Supported API: true |
private int |
minimumArgumentCount
|
static String |
MINUTE_FMT
|
static String |
MOD
Supported API: true |
static String |
MONTH_FMT
|
static String |
MULTIPLY
Supported API: true |
private String |
name
|
static String |
NLSSORT
Supported API: true |
static String |
NULL_VALUE
Supported API: true |
protected static long |
OLD_FORMAT_VERSION_UID
|
private static String |
RESOURCE
|
static String |
ROUND
Supported API: true |
static String |
RTRIM
Supported API: true |
(package private) static long |
serialVersionUID
|
static String |
SIGN
Supported API: true |
static String |
SOUNDEX
Supported API: true |
static String |
STDDEV
Supported API: true |
static String |
SUB_STRING
Supported API: true |
static String |
SUBTRACT
Supported API: true |
static String |
SUM
Supported API: true |
static String |
SYSDATE
Supported API: false |
static String |
TIME_DIFFERENCE_IN_DAY
|
static String |
TIME_DIFFERENCE_IN_HOUR
|
static Object |
TIME_SQL_FORMAT
|
static Object |
TIMESTAMP_SQL_FORMAT
|
static String |
TO_CHAR
Supported API: true |
static String |
TO_DATE
Supported API: false |
static String |
TO_DATE_FUNCTION
Deprecated. Use TO_DATE |
static String |
TO_NUMBER
Supported API: true |
static String |
TRUNC_FUNC
Deprecated. Use TRUNCATE |
static String |
TRUNCATE
Supported API: true |
static String |
UPPER
Supported API: true |
static String |
UPPER_FUNCTION
Deprecated. Use UPPER |
static String |
YEAR_FMT
|
Fields inherited from interface wt.query.ColumnExpression |
ADVANCED_QUERY, ADVANCED_QUERY_ENABLED, COLUMN_ALIAS, JAVA_TYPE |
Fields inherited from interface wt.query.Expression |
FROM_COUNT |
Fields inherited from interface wt.query.RelationalExpression |
BIND_PARAMETER |
Constructor Summary | |
|
SQLFunction()
Supported API: false |
|
SQLFunction(String a_function)
Deprecated. Use newSQLFunction() |
private |
SQLFunction(String a_function,
boolean a_isAggregate,
int a_minimumArgumentCount,
int a_maximumArgumentCount)
|
|
SQLFunction(String a_function,
RelationalExpression a_arg1)
Deprecated. Use newSQLFunction(String, ColumnExpression) |
|
SQLFunction(String a_function,
RelationalExpression a_arg1,
RelationalExpression a_arg2)
Deprecated. Use newSQLFunction(String, ColumnExpression, ColumnExpression) |
|
SQLFunction(String function,
String format)
Deprecated. Replaced by SQLFunction(String, RelationalExpression, RelationalExpression) |
Method Summary | |
private void |
argumentsValidate(Vector a_Arguments)
|
ColumnExpression |
getArgumentAt(int a_position)
Returns the argument at the specfied position. |
Vector |
getArguments()
Gets the object for the association that plays role: arguments. |
Object |
getBindParameter()
Gets the value of the attribute: bindParameter; Returns a bind parameter for this expression (if supported). |
ClassAttribute |
getClassAttribute()
Deprecated. at R6.0, use setArgumentAt(ColumnExpression, int) and getArguementAt(int) |
List |
getClassAttributes()
Supported API: false |
String |
getColumnAlias()
Gets the value of the attribute: columnAlias; Alias for the column expression. |
private DMLGenerator |
getDMLGenerator()
|
String |
getExpression(boolean a_useBind,
Vector a_tableInfos,
Vector a_aliases,
boolean a_outerJoin)
Return string representation of this expression. |
int |
getFromCount()
Gets the value of the attribute: fromCount; Number of from index values that this expression requires Supported API: false |
static int |
getFunctionCount()
Gets the value of the attribute: functionCount; Returns the number of defined functions. |
Class |
getJavaType()
Gets the value of the attribute: javaType; The java type of this expression. |
int |
getMaximumArgumentCount()
Gets the value of the attribute: maximumArgumentCount. |
int |
getMinimumArgumentCount()
Gets the value of the attribute: minimumArgumentCount. |
String |
getName()
Gets the value of the attribute: name; Specifies the function name. |
boolean |
isAdvancedQuery()
Gets the value of the attribute: advancedQuery; Indicates if the expression uses advanced query capabilities. |
boolean |
isAdvancedQueryEnabled()
Gets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled. |
boolean |
isAggregate()
Gets the value of the attribute: aggregate. |
static Enumeration |
list()
Lists all defined SQL Functions. |
static Vector |
list(boolean a_scalarOnly,
int a_minimumArgumentCount,
int a_maximumArgumentCount)
Lists all defined SQL Functions meeting that match the specified parameters. |
static SQLFunction |
newSQLFunction(String a_functionName)
Constructs a new SQLFunction. |
static SQLFunction |
newSQLFunction(String a_functionName,
ColumnExpression a_argument)
Constructs a new SQLFunction. |
static SQLFunction |
newSQLFunction(String a_functionName,
ColumnExpression[] a_arguments)
Constructs a new SQLFunction. |
static SQLFunction |
newSQLFunction(String a_functionName,
ColumnExpression a_argument_1,
ColumnExpression a_argument_2)
Constructs a new SQLFunction. |
static SQLFunction |
newSQLFunction(String a_functionName,
ColumnExpression a_argument_1,
ColumnExpression a_argument_2,
ColumnExpression a_argument_3)
Constructs a new SQLFunction. |
void |
readExternal(ObjectInput input)
Reads the non-transient fields of this class from an external source. |
private boolean |
readOldVersion(ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source, which is not the current version. |
protected boolean |
readVersion(SQLFunction thisObject,
ObjectInput input,
long readSerialVersionUID,
boolean passThrough,
boolean superDone)
Reads the non-transient fields of this class from an external source. |
void |
setAdvancedQueryEnabled(boolean a_AdvancedQueryEnabled)
Sets the value of the attribute: advancedQueryEnabled; Indicates if advanced query capabilities are enabled. |
void |
setArgumentAt(ColumnExpression a_argument,
int a_position)
Sets the argument at the specfied position. |
void |
setArgumentAt(RelationalExpression a_argument,
int a_position)
Deprecated. Use setArgumentAt(ColumnExpression, int) |
void |
setArguments(Vector a_Arguments)
Sets the object for the association that plays role: arguments. |
void |
setClassAttribute(ClassAttribute a_ClassAttribute)
Deprecated. at R6.0, use setArgumentAt(ColumnExpression, int) and getArguementAt(int) |
void |
setColumnAlias(String a_ColumnAlias)
Sets the value of the attribute: columnAlias; Alias for the column expression. |
int |
setFromAlias(String[] a_aliases,
int a_offset)
This method sets the FROM clause alias for this expression. |
String |
toString()
Formats a string representation of this function. |
int |
validate(TableExpression[] a_tableExpressions,
int a_offset)
This method validates this expression against the specified table expression. |
void |
writeExternal(ObjectOutput output)
Writes the non-transient fields of this class to an external source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private String name
public static final String ABS
public static final String UPPER
public static final String LOWER
public static final String TO_CHAR
public static final String AVERAGE
public static final String MAXIMUM
public static final String MINIMUM
public static final String SUM
public static final String COUNT
private boolean aggregate
private int minimumArgumentCount
private int maximumArgumentCount
public static final String TO_DATE
public static final String TRUNCATE
public static final String CEIL
public static final String FLOOR
public static final String LOG
public static final String MOD
public static final String ROUND
public static final String SIGN
public static final String LTRIM
public static final String RTRIM
public static final String SOUNDEX
public static final String LENGTH
public static final String SYSDATE
public static final String TO_NUMBER
public static final String NLSSORT
public static final String ADD
public static final String SUBTRACT
public static final String DIVIDE
public static final String MULTIPLY
public static final String GET_SECONDS
public static final String GET_MINUTES
public static final String GET_HOURS
public static final String GET_DAY
public static final String GET_MONTH
public static final String GET_YEAR
public static final String CONCAT
public static final String SUB_STRING
public static final String STDDEV
public static final String IN_STRING
public static final String NULL_VALUE
public static final String DECODE
public static final String BITAND
private Vector arguments
private String columnAlias
private transient boolean advancedQueryEnabled
static final long serialVersionUID
public static final long EXTERNALIZATION_VERSION_UID
protected static final long OLD_FORMAT_VERSION_UID
public static final String MATCH_STRING
public static final String MATCH_NUMBER
public static final String MATCH_TIMESTAMP
public static final boolean DEBUG
private static final DebugWriter DEBUG_LOG
public static final String MINUTE_FMT
public static final String HOUR_FMT
public static final String DAY_FMT
public static final String MONTH_FMT
public static final String YEAR_FMT
public static final int HOUR_PER_DAY
public static final String TIME_DIFFERENCE_IN_DAY
public static final String TIME_DIFFERENCE_IN_HOUR
public static final String TRUNC_FUNC
public static final String TO_DATE_FUNCTION
public static final String UPPER_FUNCTION
public static final Object DATE_SQL_FORMAT
public static final Object TIME_SQL_FORMAT
public static final Object TIMESTAMP_SQL_FORMAT
private static final Hashtable INFO_MAP
private static DMLGenerator dmlGenerator
Constructor Detail |
public SQLFunction()
public SQLFunction(String a_function)
a_function
- Specifies the function name.public SQLFunction(String a_function, RelationalExpression a_arg1)
a_function
- Specifies the function name.a_arg1
- Specifies the first argument to the function.public SQLFunction(String a_function, RelationalExpression a_arg1, RelationalExpression a_arg2)
a_function
- Specifies the function name.a_arg1
- Specifies the first argument to the function.a_arg2
- Specifies the first argument to the function.private SQLFunction(String a_function, boolean a_isAggregate, int a_minimumArgumentCount, int a_maximumArgumentCount)
a_function
- Specifies the function name.a_isAggregate
- Specifies the first argument to the function.a_minimumArgumentCount
- a_maximumArgumentCount
- public SQLFunction(String function, String format) throws QueryException
function
- The function to be applied
for persistent objects.format
- The format for the function.
QueryException
- Occurs if the given function/format pair is not supported.Method Detail |
public void writeExternal(ObjectOutput output) throws IOException
writeExternal
in interface Externalizable
output
-
IOException
public void readExternal(ObjectInput input) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
input
-
IOException
ClassNotFoundException
protected boolean readVersion(SQLFunction thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
thisObject
- input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
private boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone) throws IOException, ClassNotFoundException
input
- readSerialVersionUID
- passThrough
- superDone
-
IOException
ClassNotFoundException
public String getName()
public boolean isAggregate()
public int getMinimumArgumentCount()
public int getMaximumArgumentCount()
public static int getFunctionCount()
public ClassAttribute getClassAttribute()
public void setClassAttribute(ClassAttribute a_ClassAttribute) throws WTPropertyVetoException
a_ClassAttribute
-
WTPropertyVetoException
public Vector getArguments()
public void setArguments(Vector a_Arguments) throws WTPropertyVetoException
a_Arguments
-
WTPropertyVetoException
private void argumentsValidate(Vector a_Arguments) throws WTPropertyVetoException
a_Arguments
-
WTPropertyVetoException
public static SQLFunction newSQLFunction(String a_functionName)
a_functionName
-
public static Enumeration list()
public void setArgumentAt(RelationalExpression a_argument, int a_position) throws WTPropertyVetoException
a_argument
- Argument to set.a_position
- Position (0 based) to set the argument
WTPropertyVetoException
public ColumnExpression getArgumentAt(int a_position)
a_position
- Position (0 based) to set the argument
public static Vector list(boolean a_scalarOnly, int a_minimumArgumentCount, int a_maximumArgumentCount)
a_scalarOnly
- List only scalar functions.a_minimumArgumentCount
- List functions with minimum argument count greater than or equal to this value. If this value is less than 0, then this criteria is ignored.a_maximumArgumentCount
- List functions with maximum argument count less than or equal to this value. If this value is less than 0, then this criteria is ignored.
public static SQLFunction newSQLFunction(String a_functionName, ColumnExpression a_argument) throws QueryException
a_functionName
- a_argument
-
QueryException
public static SQLFunction newSQLFunction(String a_functionName, ColumnExpression a_argument_1, ColumnExpression a_argument_2) throws QueryException
a_functionName
- a_argument_1
- a_argument_2
-
QueryException
public static SQLFunction newSQLFunction(String a_functionName, ColumnExpression a_argument_1, ColumnExpression a_argument_2, ColumnExpression a_argument_3) throws QueryException
a_functionName
- a_argument_1
- a_argument_2
- a_argument_3
-
QueryException
public static SQLFunction newSQLFunction(String a_functionName, ColumnExpression[] a_arguments) throws QueryException
a_functionName
- a_arguments
-
QueryException
public void setArgumentAt(ColumnExpression a_argument, int a_position) throws WTPropertyVetoException
a_argument
- Argument to set.a_position
- Position (0 based) to set the argument
WTPropertyVetoException
public String getColumnAlias()
getColumnAlias
in interface ColumnExpression
public void setColumnAlias(String a_ColumnAlias) throws WTPropertyVetoException
setColumnAlias
in interface ColumnExpression
a_ColumnAlias
-
WTPropertyVetoException
public Class getJavaType() throws WTException
getJavaType
in interface ColumnExpression
WTException
public boolean isAdvancedQuery() throws WTException
isAdvancedQuery
in interface ColumnExpression
WTException
public boolean isAdvancedQueryEnabled()
isAdvancedQueryEnabled
in interface ColumnExpression
public void setAdvancedQueryEnabled(boolean a_AdvancedQueryEnabled)
setAdvancedQueryEnabled
in interface ColumnExpression
a_AdvancedQueryEnabled
- public int getFromCount()
getFromCount
in interface Expression
public int validate(TableExpression[] a_tableExpressions, int a_offset) throws QueryException
validate
in interface Expression
a_tableExpressions
- Table expression to validate against.a_offset
- Offset index into the TableExpression array for the next valid TableExpression
QueryException
public int setFromAlias(String[] a_aliases, int a_offset)
setFromAlias
in interface Expression
a_aliases
- Array of aliases for expressionsa_offset
- Offset index into the alias array for the next valid alias
public Object getBindParameter() throws WTException
getBindParameter
in interface RelationalExpression
WTException
public String getExpression(boolean a_useBind, Vector a_tableInfos, Vector a_aliases, boolean a_outerJoin) throws QueryException
getExpression
in interface RelationalExpression
a_useBind
- Indicates that bind variables should be used for this expression.a_tableInfos
- a_aliases
- a_outerJoin
- Indicates that outer join syntax should be used for this expression.
QueryException
public List getClassAttributes()
getClassAttributes
in interface RelationalExpression
public String toString()
private DMLGenerator getDMLGenerator()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |