org.datanucleus.store.mapped.expression
Class SubqueryExpression

java.lang.Object
  extended by org.datanucleus.store.mapped.expression.ScalarExpression
      extended by org.datanucleus.store.mapped.expression.BooleanExpression
          extended by org.datanucleus.store.mapped.expression.SubqueryExpression

public class SubqueryExpression
extends BooleanExpression

An expression representing a subquery.

Version:
$Revision: 1.6 $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
ScalarExpression.DatastoreFieldExpression, ScalarExpression.DyadicOperator, ScalarExpression.ExpressionList, ScalarExpression.IllegalArgumentTypeException, ScalarExpression.IllegalOperationException, ScalarExpression.MethodInvocationException, ScalarExpression.MonadicOperator, ScalarExpression.Operator
 
Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
aliasIdentifier, checkForTypeAssignability, expressionList, FILTER, LOCALISER, lowestOperator, mapping, OP_ADD, OP_AND, OP_BETWEEN, OP_COM, OP_CONCAT, OP_DIV, OP_EQ, OP_GT, OP_GTEQ, OP_IN, OP_IS, OP_ISNOT, OP_LIKE, OP_LT, OP_LTEQ, OP_MOD, OP_MUL, OP_NEG, OP_NOT, OP_NOTEQ, OP_NOTIN, OP_NOTLIKE, OP_OR, OP_SUB, parameterName, PROJECTION, qs, st, te
 
Constructor Summary
SubqueryExpression(QueryExpression qs, QueryExpression expr)
          Construct an expression containing this subquery.
 
Method Summary
 void all()
          Method to convert the subquery statement into ALL ({subquery})
 void any()
          Method to convert the subquery statement into ANY ({subquery})
 BooleanExpression containsMethod(ScalarExpression expr)
          Method to return an expression for whether the specified expression is contained in this subquery.
 void exists()
          Method to convert the subquery statement into EXISTS ({subquery})
 QueryExpression getSubquery()
          Convenience accessor for the subquery expression.
 BooleanExpression in(ScalarExpression expr)
          Method to convert the subquery statement into "expr IN ({subquery})"
 BooleanExpression isEmptyMethod()
          Method to return an expression for whether the subquery is empty (no results).
 NumericExpression sizeMethod()
          Method to return the size of the subquery.
 
Methods inherited from class org.datanucleus.store.mapped.expression.BooleanExpression
and, eor, eq, ior, neg, not, noteq
 
Methods inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
accessField, add, as, assertValidTypeForParameterComparison, callMethod, cast, checkForTypeAssignability, com, div, encloseWithInParentheses, equals, getAlias, getConsistentTypeForParameterComparison, getExpressionList, getLogicSetExpression, getMapping, getNonAliasExpression, getQueryExpression, gt, gteq, instanceOf, lt, lteq, mod, mul, setParameterName, sub, toStatementText, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubqueryExpression

public SubqueryExpression(QueryExpression qs,
                          QueryExpression expr)
Construct an expression containing this subquery.

Parameters:
qs - the QueryExpression
expr - Expression for the subquery
Method Detail

getSubquery

public QueryExpression getSubquery()
Convenience accessor for the subquery expression.

Returns:
Subquery expression

all

public void all()
Method to convert the subquery statement into ALL ({subquery})


any

public void any()
Method to convert the subquery statement into ANY ({subquery})


exists

public void exists()
Method to convert the subquery statement into EXISTS ({subquery})


in

public BooleanExpression in(ScalarExpression expr)
Method to convert the subquery statement into "expr IN ({subquery})"

Overrides:
in in class BooleanExpression
Parameters:
expr - The expression that is being contained
Returns:
BooleanExpression for the IN

containsMethod

public BooleanExpression containsMethod(ScalarExpression expr)
Method to return an expression for whether the specified expression is contained in this subquery. Uses IN operator.

Parameters:
expr - The expression that is being contained
Returns:
BooleanExpression for the contains(expr)

sizeMethod

public NumericExpression sizeMethod()
Method to return the size of the subquery.

Returns:
Size of the subquery

isEmptyMethod

public BooleanExpression isEmptyMethod()
Method to return an expression for whether the subquery is empty (no results).

Returns:
BooleanExpression for the isEmpty()


Copyright © 2010. All Rights Reserved.