org.datanucleus.store.mapped.expression
Class ExistsExpression

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.ExistsExpression

public class ExistsExpression
extends BooleanExpression

Perform a exists function on a Query Expression returning a true boolean value if one or more elements are retrieved.

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
ExistsExpression(QueryExpression qs, QueryExpression argumentExpression)
          Constructs a expression for existence of the argument expression.
ExistsExpression(QueryExpression qs, QueryExpression argumentExpression, boolean truthTest)
          Constructs a expression for existence (or not) of the argument expression.
 
Method Summary
 BooleanExpression and(ScalarExpression expr)
          Conditional And.
 BooleanExpression not()
          Logical complement
 
Methods inherited from class org.datanucleus.store.mapped.expression.BooleanExpression
eor, eq, in, ior, neg, 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

ExistsExpression

public ExistsExpression(QueryExpression qs,
                        QueryExpression argumentExpression)
Constructs a expression for existence of the argument expression.

Parameters:
qs - the QueryExpression
argumentExpression - the QueryExpression returning records to the exists function

ExistsExpression

public ExistsExpression(QueryExpression qs,
                        QueryExpression argumentExpression,
                        boolean truthTest)
Constructs a expression for existence (or not) of the argument expression. Create an "EXISTS", or "NOT EXISTS" depending on the truth flag.

Parameters:
qs - the QueryExpression
argumentExpression - the QueryExpression returning records to the exists function
truthTest - true to perform a "exists", and false to perform a "not exists"
Method Detail

not

public BooleanExpression not()
Description copied from class: ScalarExpression
Logical complement

Overrides:
not in class BooleanExpression
Returns:
the result value is false if operand is true; otherwise, the result is true.

and

public BooleanExpression and(ScalarExpression expr)
Description copied from class: ScalarExpression
Conditional And. Evaluates its right-hand operand only if the value of its left-hand operand is true.

Overrides:
and in class BooleanExpression
Parameters:
expr - the right-hand operand
Returns:
the result value is true if both operand values are true; otherwise, the result is false.


Copyright © 2010. All Rights Reserved.