org.datanucleus.store.mapped.expression
Class MapLiteral

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

public class MapLiteral
extends ScalarExpression

An SQL expression that will test if a column of a table falls within the given Map. This is used for Querys where a Map is passed in as a parameter.

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
MapLiteral(QueryExpression qs, JavaTypeMapping mapping, java.util.Map map)
          Constructor.
 
Method Summary
 BooleanExpression containsEntryMethod(ScalarExpression expr)
          Method to check the containing of an entry in the Map.
 BooleanExpression containsKeyMethod(ScalarExpression expr)
          Method to check the containing of a key in the Map.
 BooleanExpression containsMethod(ScalarExpression expr)
          Method to check the containing of a value in the Map.
 BooleanExpression containsValueMethod(ScalarExpression expr)
          Method to check the containing of a value in the Map.
 ScalarExpression getMethod(ScalarExpression expr)
          Method to get a value from the Map for a key
 BooleanExpression isEmptyMethod()
          Method to check for emptiness of the collection.
 
Methods inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
accessField, 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

MapLiteral

public MapLiteral(QueryExpression qs,
                  JavaTypeMapping mapping,
                  java.util.Map map)
Constructor.

Parameters:
qs - The QueryStatement the MapLiteral will be used in.
mapping - The mapping to the Map
map - The Map that is the value.
Method Detail

containsMethod

public BooleanExpression containsMethod(ScalarExpression expr)
Method to check the containing of a value in the Map. Return the BooleanExpression that results from MapValueLiteral.contains(SQLExpression).

Parameters:
expr - The SQLExpression that is checked for membership in the Map.
Returns:
The BooleanExpression that results from MapValueLiteral.contains(SQLExpression).

containsValueMethod

public BooleanExpression containsValueMethod(ScalarExpression expr)
Method to check the containing of a value in the Map. Return the BooleanExpression that results from MapValueLiteral.contains(SQLExpression).

Parameters:
expr - The SQLExpression that is checked for membership in the Map.
Returns:
The BooleanExpression that results from MapValueLiteral.contains(SQLExpression).

containsKeyMethod

public BooleanExpression containsKeyMethod(ScalarExpression expr)
Method to check the containing of a key in the Map. Return the BooleanExpression that results from MapKeyLiteral.contains(SQLExpression).

Parameters:
expr - The SQLExpression that is checked for membership in the Map.
Returns:
The BooleanExpression that results from MapKeyLiteral.contains(SQLExpression).

containsEntryMethod

public BooleanExpression containsEntryMethod(ScalarExpression expr)
Method to check the containing of an entry in the Map. Return the BooleanExpression that results from MapValueLiteral.contains(SQLExpression) and MapKeyLiteral.contains(SQLExpression).

Parameters:
expr - The SQLExpression that is checked for membership in the Map.
Returns:
The BooleanExpression that results from MapValueLiteral.contains(SQLExpression) and MapKeyLiteral.contains(SQLExpression).

getMethod

public ScalarExpression getMethod(ScalarExpression expr)
Method to get a value from the Map for a key

Parameters:
expr - The key argument expression
Returns:
The statement

isEmptyMethod

public BooleanExpression isEmptyMethod()
Method to check for emptiness of the collection.

Returns:
The BooleanExpression.


Copyright © 2010. All Rights Reserved.