org.apache.openjpa.jdbc.kernel.exps
Class SQLEmbed
java.lang.Object
org.apache.openjpa.jdbc.kernel.exps.SQLEmbed
- All Implemented Interfaces:
- java.io.Serializable, JDBCFilterListener, org.apache.openjpa.kernel.exps.FilterListener
- Direct Known Subclasses:
- SQLExpression, SQLValue
public class SQLEmbed
- extends java.lang.Object
- implements JDBCFilterListener
Simple listener which embeds its SQL argument into the query. Listens
on sql
.
Example:
"price < sql(\"(SELECT AVG (PRICE) FROM PRODUCT_TABLE)\")"
- See Also:
- Serialized Form
Field Summary |
static java.lang.String |
TAG
|
Method Summary |
void |
appendTo(SQLBuffer buf,
FilterValue target,
FilterValue[] args,
ClassMapping type,
JDBCStore store)
Append the SQL for this expression or value. |
java.lang.Object |
evaluate(java.lang.Object target,
java.lang.Class targetClass,
java.lang.Object[] args,
java.lang.Class[] argClasses,
java.lang.Object candidate,
org.apache.openjpa.kernel.StoreContext ctx)
|
boolean |
expectsArguments()
|
boolean |
expectsTarget()
|
java.lang.String |
getTag()
|
java.lang.Class |
getType(java.lang.Class targetClass,
java.lang.Class[] argClasses)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TAG
public static java.lang.String TAG
SQLEmbed
public SQLEmbed()
getTag
public java.lang.String getTag()
- Specified by:
getTag
in interface org.apache.openjpa.kernel.exps.FilterListener
expectsArguments
public boolean expectsArguments()
- Specified by:
expectsArguments
in interface org.apache.openjpa.kernel.exps.FilterListener
expectsTarget
public boolean expectsTarget()
- Specified by:
expectsTarget
in interface org.apache.openjpa.kernel.exps.FilterListener
evaluate
public java.lang.Object evaluate(java.lang.Object target,
java.lang.Class targetClass,
java.lang.Object[] args,
java.lang.Class[] argClasses,
java.lang.Object candidate,
org.apache.openjpa.kernel.StoreContext ctx)
- Specified by:
evaluate
in interface org.apache.openjpa.kernel.exps.FilterListener
appendTo
public void appendTo(SQLBuffer buf,
FilterValue target,
FilterValue[] args,
ClassMapping type,
JDBCStore store)
- Description copied from interface:
JDBCFilterListener
- Append the SQL for this expression or value.
- Specified by:
appendTo
in interface JDBCFilterListener
- Parameters:
buf
- the SQL buffer to append totarget
- the target to act on, or null if the listener
doesn't expect a targetargs
- the values of the arguments given in the filter, or
null if this listener doesn't expect argumentstype
- the class mapping for the query's candidate classstore
- the store that owns the query
getType
public java.lang.Class getType(java.lang.Class targetClass,
java.lang.Class[] argClasses)
- Specified by:
getType
in interface org.apache.openjpa.kernel.exps.FilterListener