|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--ModSQL.AbstractFunction
|
+--ModSQL.Operator
|
+--ModSQL.Operator_Exists
Implementation of EXISTS operator.
| Field Summary | |
private Boolean |
constant_result
If is_constant, this variable holds the constant result. |
private boolean |
is_constant
True if operator returns a constant value (table is constant). |
private Table |
table
Table to scan. |
| Fields inherited from class ModSQL.AbstractFunction |
all_constant, constant_non_null, evaluate_order, evaluate_order_array, out_of_order, parameter_constant, parameter_value, parameters, parameters_array |
| Fields inherited from interface ModSQL.Function |
MATCH_BEGINS, MATCH_EQU, MATCH_GT, MATCH_GTE, MATCH_LT, MATCH_LTE, MATCH_NE |
| Constructor Summary | |
(package private) |
Operator_Exists()
|
| Method Summary | |
Object |
evaluate(boolean aggregate)
Evaluate table and compute the function. |
Object |
evaluate(int match_op,
Object match_value)
Evaluate table and compute the function. |
String |
functionName()
Returns "#EXISTS". |
int |
getMaxResultSize()
Returns -1 as this operator will never return a String object. |
int |
getSQLType()
Returns Types.BIT. |
boolean |
isConstant()
Returns true if the table is constant. |
void |
optimize()
Prepare the function for use. |
String |
postfixParameters()
Returns table as string if set. |
void |
registerWith(Object o)
Since the table is not a regular parameter, this method is need to ensure the table can register itself with objects as needed. |
void |
setTable(Table table)
Specify the table to be scanned. |
| Methods inherited from class ModSQL.Operator |
addAllParameters, addAllParametersNegate, addAllParametersNot, removeDoubleNegation, removeDoubleNot |
| Methods inherited from class ModSQL.AbstractFunction |
addParameter, convertToSQLType, evaluateConstantParameters, evaluateOrder, evaluateParameters, evaluateParameters, getCompatableType, getObjectSQLType, getParameter, getParameterCount, isAggregate, prefixParameters, reset, toString |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private Table table
private boolean is_constant
private Boolean constant_result
| Constructor Detail |
Operator_Exists()
| Method Detail |
public void setTable(Table table)
table - table to scan
public void registerWith(Object o)
throws SQLException
registerWith in class AbstractFunctiono - object to register withSQLException - if a database error occurs
public void optimize()
throws SQLException
Prepare the function for use. This method ensures that there are no parameters (except the table). If the table is constant, it is checked for rows and the result is stored.
optimize in class AbstractFunctionSQLException - if the parameters are invalidpublic String functionName()
functionName in class AbstractFunctionpublic String postfixParameters()
postfixParameters in class AbstractFunctionpublic boolean isConstant()
isConstant in class AbstractFunctionpublic int getSQLType()
public int getMaxResultSize()
public Object evaluate(boolean aggregate)
throws SQLException,
EndOfTable
aggregate - ignoredSQLException - if a database-access error occursEndOfTable - if thrown by a parameter
public Object evaluate(int match_op,
Object match_value)
throws SQLException,
EndOfTable
evaluate in class AbstractFunctionmatch_op - how the value should be matchedmatch_value - desired valueSQLException - if a database-access error occursEndOfTable - if thrown by a parameter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||