com.solarmetric.kodo.impl.jdbc.query.listen
Class SQLEmbed
java.lang.Object
|
+--com.solarmetric.kodo.impl.jdbc.query.listen.SQLEmbed
- All Implemented Interfaces:
- FilterListener, JDBCFilterListener
- Direct Known Subclasses:
- LitSQLEmbed, SQLExpression, SQLValue
- abstract class SQLEmbed
- extends Object
- implements JDBCFilterListener
Simple listener which embeds the argument as a value or boolean
expression into the where clause generated by the query.
|
Constructor Summary |
(package private) |
SQLEmbed()
|
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SQLEmbed
SQLEmbed()
expectsArgument
public boolean expectsArgument()
- Description copied from interface:
FilterListener
- Return true if this extension expects an argument to act on. Some
extensions may not need arguments; for example, an extension to
switch a string to upper case might be of the form:
field.ext:toUpperCase ().
- Specified by:
expectsArgument in interface FilterListener
expectsTarget
public boolean expectsTarget()
- Description copied from interface:
FilterListener
- Return true if this extension expects a target to act on. Some
extensions act on a field or object value; others stand alone.
field.ext:toUpperCase () acts on the target
field but has no arguments, while another possible form,
ext:toUpperCase (field) has no target but does have an
argument.
- Specified by:
expectsTarget in interface FilterListener
evaluate
public Object evaluate(Object target,
Object arg,
Object candidate,
PersistenceManagerImpl pm)
- Description copied from interface:
FilterListener
- Evaluate the given expression. This method is used when
evaluating in-memory expressions. The method used when evaluating
data store expressions will change depending on the data store in use.
- Specified by:
evaluate in interface FilterListener
- Following copied from interface:
com.solarmetric.kodo.query.FilterListener
- Parameters:
target - the target object / field value to act on; will be
null if this extension does not expect a targetarg - the value of the argument given in the filter; will
be null if this extension does not expect an
argumentcandidate - the candidate object being evaluatedpm - a persistence manager to use if needed- Returns:
- the value of the extension for this candidate; if
this extension is an expression, this method should
return
Boolean.TRUE or Boolean.FALSE - Throws:
JDOUserException - if this extension does not support
in-memory operation
where
public void where(QuerySQLBuffer buf,
JDBCValue target,
JDBCValue arg,
ClassMapping type,
PersistenceManagerImpl pm)
- Description copied from interface:
JDBCFilterListener
- Append the SQL for this expression or value.
- Specified by:
where in interface JDBCFilterListener
- Following copied from interface:
com.solarmetric.kodo.impl.jdbc.query.JDBCFilterListener
- Parameters:
buf - the SQL buffer to append totarget - the target to act on; this will usually be a
SQLPath, but depending on usage could also be
other values; it will be null if the listener doesn't
expect a targetarg - the value of the argument given in the filter; this
will usually be a Constant, but will be
null if this listener doesn't expect an argumentmapping - the class mapping for the query's candidate classpm - the persistence manager that owns the query
Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.