org.datanucleus.store.mapped.expression
Class ReferenceExpression

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

public class ReferenceExpression
extends ScalarExpression

Represents a reference field/object (interface/object) in a JDOQL query.

Version:
$Revision: 1.9 $

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
ReferenceExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te)
          Constructor for a reference expression, using the mapping of the field, and the expression for the table.
 
Method Summary
 ScalarExpression accessField(java.lang.String fieldName, boolean innerJoin)
          Method invoked when accessing a field in the reference.
 ScalarExpression cast(java.lang.Class castType)
          Method for casting a reference expression to some other type in the query.
 BooleanExpression eq(ScalarExpression expr)
          Method for use when handling the equality of reference expressions.
 BooleanExpression noteq(ScalarExpression expr)
          Method for use when handling the inequality of reference expressions.
 
Methods inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
add, and, as, assertValidTypeForParameterComparison, callMethod, checkForTypeAssignability, com, div, encloseWithInParentheses, eor, equals, getAlias, getConsistentTypeForParameterComparison, getExpressionList, getLogicSetExpression, getMapping, getNonAliasExpression, getQueryExpression, gt, gteq, in, instanceOf, ior, lt, lteq, mod, mul, neg, not, setParameterName, sub, toStatementText, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferenceExpression

public ReferenceExpression(QueryExpression qs,
                           JavaTypeMapping mapping,
                           LogicSetExpression te)
Constructor for a reference expression, using the mapping of the field, and the expression for the table.

Parameters:
qs - The Query Statement
mapping - The mapping for the field whose interface we are expressing
te - The expression for the table of the interface.
Method Detail

cast

public ScalarExpression cast(java.lang.Class castType)
Method for casting a reference expression to some other type in the query.

Overrides:
cast in class ScalarExpression
Parameters:
castType - The type to cast it to.
Returns:
The expression for the casted reference

eq

public BooleanExpression eq(ScalarExpression expr)
Method for use when handling the equality of reference expressions.

Overrides:
eq in class ScalarExpression
Parameters:
expr - The expression to compare against
Returns:
Expression whether the expressions are equal

noteq

public BooleanExpression noteq(ScalarExpression expr)
Method for use when handling the inequality of reference expressions.

Overrides:
noteq in class ScalarExpression
Parameters:
expr - The expression to compare against
Returns:
Expression whether the expressions are not equal

accessField

public ScalarExpression accessField(java.lang.String fieldName,
                                    boolean innerJoin)
Method invoked when accessing a field in the reference. This is currently not available - you must cast it to a concrete type (since the reference doesnt have any fields!).

Overrides:
accessField in class ScalarExpression
Parameters:
fieldName - Name of the field to access
innerJoin - whether to join using an inner join
Returns:
Expression representing the field of this reference


Copyright © 2010. All Rights Reserved.