org.datanucleus.store.rdbms.sql.method
Class ArrayContainsMethod

java.lang.Object
  extended by org.datanucleus.store.rdbms.sql.method.AbstractSQLMethod
      extended by org.datanucleus.store.rdbms.sql.method.ArrayContainsMethod
All Implemented Interfaces:
SQLMethod

public class ArrayContainsMethod
extends AbstractSQLMethod

Method for evaluating {arrExpr}.contains(elemExpr). Returns a BooleanExpression.


Field Summary
 
Fields inherited from class org.datanucleus.store.rdbms.sql.method.AbstractSQLMethod
clr, exprFactory, LOCALISER, stmt
 
Constructor Summary
ArrayContainsMethod()
           
 
Method Summary
protected  SQLExpression containsAsSubquery(ArrayExpression arrExpr, SQLExpression elemExpr)
          Method to return an expression for Collection.contains using a subquery "EXISTS".
 SQLExpression getExpression(SQLExpression expr, java.util.List args)
          Return the expression for this SQL function.
 
Methods inherited from class org.datanucleus.store.rdbms.sql.method.AbstractSQLMethod
getMappingForClass, setStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayContainsMethod

public ArrayContainsMethod()
Method Detail

getExpression

public SQLExpression getExpression(SQLExpression expr,
                                   java.util.List args)
Description copied from interface: SQLMethod
Return the expression for this SQL function.

Parameters:
expr - The expression that it is invoked on
args - Arguments passed in
Returns:
The SQL expression using the SQL function

containsAsSubquery

protected SQLExpression containsAsSubquery(ArrayExpression arrExpr,
                                           SQLExpression elemExpr)
Method to return an expression for Collection.contains using a subquery "EXISTS". This is for use when there are "!contains" or "OR" operations in the filter. Creates the following SQL, and returns a BooleanSubqueryExpression ("EXISTS (subquery)")

Parameters:
arrExpr - Collection expression
elemExpr - Expression for the element
Returns:
Contains expression


Copyright © 2009. All Rights Reserved.