org.datanucleus.store.mapped.expression
Class ArrayExpression

java.lang.Object
  extended by org.datanucleus.store.mapped.expression.ScalarExpression
      extended by org.datanucleus.store.mapped.expression.ArrayExpression
Direct Known Subclasses:
ArrayLiteral

public class ArrayExpression
extends ScalarExpression

Representation of array expression. Either backed by ScalarExpressions, or by an array field.


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
protected ArrayExpression(QueryExpression qs)
          Constructor
  ArrayExpression(QueryExpression qs, JavaTypeMapping ownerMapping, LogicSetExpression te, ArrayStore arrayStore, java.lang.String fieldName)
          Constructor.
  ArrayExpression(QueryExpression qs, ScalarExpression[] expr)
          Constructor
 
Method Summary
 ScalarExpression accessField(java.lang.String subfieldName, boolean innerJoin)
          Access a field in an array
 BooleanExpression containsMethod(ScalarExpression expr)
          Executed when the contains() method is found in a query filter.
 NumericExpression lengthMethod()
          Executed when the length() method is found in a query filter.
 NumericExpression sizeMethod()
          Executed when the size() method is found in a query filter.
 
Methods inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
add, and, as, assertValidTypeForParameterComparison, callMethod, cast, checkForTypeAssignability, com, div, encloseWithInParentheses, eor, eq, equals, getAlias, getConsistentTypeForParameterComparison, getExpressionList, getLogicSetExpression, getMapping, getNonAliasExpression, getQueryExpression, gt, gteq, in, instanceOf, ior, lt, lteq, mod, mul, neg, not, noteq, setParameterName, sub, toStatementText, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayExpression

protected ArrayExpression(QueryExpression qs)
Constructor

Parameters:
qs - The query statement

ArrayExpression

public ArrayExpression(QueryExpression qs,
                       ScalarExpression[] expr)
Constructor

Parameters:
qs - The query statement
expr - the array of expressions

ArrayExpression

public ArrayExpression(QueryExpression qs,
                       JavaTypeMapping ownerMapping,
                       LogicSetExpression te,
                       ArrayStore arrayStore,
                       java.lang.String fieldName)
Constructor.

Parameters:
qs - The Query Statement
ownerMapping - The mapping to the owner of this collection
te - The Table Expression
arrayStore - the backing store.
fieldName - Name of the field for the collection.
Method Detail

sizeMethod

public NumericExpression sizeMethod()
Executed when the size() method is found in a query filter.

Returns:
The NumericExpression resulting from the size() method.

lengthMethod

public NumericExpression lengthMethod()
Executed when the length() method is found in a query filter.

Returns:
The NumericExpression resulting from the size() method.

accessField

public ScalarExpression accessField(java.lang.String subfieldName,
                                    boolean innerJoin)
Access a field in an array

Overrides:
accessField in class ScalarExpression
Parameters:
subfieldName - the field to be accessed in this object
innerJoin - whether to inner join
Returns:
The field expression representing the required field of this object

containsMethod

public BooleanExpression containsMethod(ScalarExpression expr)
Executed when the contains() method is found in a query filter.

Parameters:
expr - The ScalarExpression passed as a parameter to contains().
Returns:
The BooleanExpression resulting from the contains() method.


Copyright © 2010. All Rights Reserved.