org.datanucleus.store.mapped.expression
Class UnknownLiteral

java.lang.Object
  extended by org.datanucleus.store.mapped.expression.ScalarExpression
      extended by org.datanucleus.store.mapped.expression.NullLiteral
          extended by org.datanucleus.store.mapped.expression.UnknownLiteral
All Implemented Interfaces:
Literal

public class UnknownLiteral
extends NullLiteral

Representation of a unknown literal in a Query. This is a special literal with the sole purpose of representing a parameter where we don't currently have the value and want to pre-compile the query to check for other errors. Simply provides wrappers for operations that we would perform on a parameter value, and returns a valid expression.


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
UnknownLiteral(QueryExpression qs)
          Creates an unknown literal.
 
Method Summary
 ScalarExpression add(ScalarExpression expr)
          Additive Operator.
 BooleanExpression and(ScalarExpression expr)
          Conditional And.
 ScalarExpression div(ScalarExpression expr)
          Division Operator.
 BooleanExpression eq(ScalarExpression expr)
          Equality operator (equals to)
 java.lang.Object getValue()
          Accessor to the literal value
 BooleanExpression gt(ScalarExpression expr)
          Relational operator (greater than)
 BooleanExpression gteq(ScalarExpression expr)
          Relational operator (greater than or equals)
 BooleanExpression in(ScalarExpression expr)
          In expression.
 BooleanExpression lt(ScalarExpression expr)
          Relational operator (lower than)
 BooleanExpression lteq(ScalarExpression expr)
          Relational operator (lower than or equals)
 ScalarExpression mod(ScalarExpression expr)
          Remainder Operator.
 ScalarExpression mul(ScalarExpression expr)
          Multiplication Operator
 BooleanExpression noteq(ScalarExpression expr)
          Equality operator (not equals to)
 ScalarExpression sub(ScalarExpression expr)
          Additive Operator.
 
Methods inherited from class org.datanucleus.store.mapped.expression.NullLiteral
getRawValue, setRawValue
 
Methods inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
accessField, as, assertValidTypeForParameterComparison, callMethod, cast, checkForTypeAssignability, com, encloseWithInParentheses, eor, equals, getAlias, getConsistentTypeForParameterComparison, getExpressionList, getLogicSetExpression, getMapping, getNonAliasExpression, getQueryExpression, instanceOf, ior, neg, not, setParameterName, toStatementText, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnknownLiteral

public UnknownLiteral(QueryExpression qs)
Creates an unknown literal.

Parameters:
qs - the QueryExpression
Method Detail

getValue

public java.lang.Object getValue()
Description copied from interface: Literal
Accessor to the literal value

Specified by:
getValue in interface Literal
Overrides:
getValue in class NullLiteral
Returns:
the value of the literal

add

public ScalarExpression add(ScalarExpression expr)
Description copied from class: ScalarExpression
Additive Operator. The binary + operator performs addition when applied to two operands of numeric type, producing the sum of the operands. If the type of either operand of a + operator is String, then the operation is string concatenation.

Overrides:
add in class NullLiteral
Parameters:
expr - the right-hand operand
Returns:
If one of the operands is String, the returned value is the string concatenation; The sum of two operands of numeric type. The left-hand operand is the minuend and the right-hand operand is the subtrahend;

eq

public BooleanExpression eq(ScalarExpression expr)
Description copied from class: ScalarExpression
Equality operator (equals to)

Overrides:
eq in class NullLiteral
Parameters:
expr - the right-hand operand
Returns:
The type of an equality expression is a boolean

noteq

public BooleanExpression noteq(ScalarExpression expr)
Description copied from class: ScalarExpression
Equality operator (not equals to)

Overrides:
noteq in class NullLiteral
Parameters:
expr - the right-hand operand
Returns:
The type of an equality expression is a boolean

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 ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
the result value is true if both operand values are true; otherwise, the result is false.

div

public ScalarExpression div(ScalarExpression expr)
Description copied from class: ScalarExpression
Division Operator. The left-hand operand is the dividend and the right-hand operand is the divisor.

Overrides:
div in class ScalarExpression
Parameters:
expr - the right-hand operator
Returns:
The binary / operator performs division, producing the quotient of its operands

gt

public BooleanExpression gt(ScalarExpression expr)
Description copied from class: ScalarExpression
Relational operator (greater than)

Overrides:
gt in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
true if the value of the left-hand operand is greater than the value of the right-hand operand, and otherwise is false.

gteq

public BooleanExpression gteq(ScalarExpression expr)
Description copied from class: ScalarExpression
Relational operator (greater than or equals)

Overrides:
gteq in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
true if the value of the left-hand operand is greater than or equal the value of the right-hand operand, and otherwise is false.

in

public BooleanExpression in(ScalarExpression expr)
Description copied from class: ScalarExpression
In expression. Return true if this is contained by expr

Overrides:
in in class ScalarExpression
Parameters:
expr - the right-hand expression
Returns:
true if the left-hand expression is contained by the right-hand expression. Otherwise the result is false.

lt

public BooleanExpression lt(ScalarExpression expr)
Description copied from class: ScalarExpression
Relational operator (lower than)

Overrides:
lt in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
true if the value of the left-hand operand is less than the value of the right-hand operand, and otherwise is false.

lteq

public BooleanExpression lteq(ScalarExpression expr)
Description copied from class: ScalarExpression
Relational operator (lower than or equals)

Overrides:
lteq in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
true if the value of the left-hand operand is less than or equal to the value of the right-hand operand, and otherwise is false.

mod

public ScalarExpression mod(ScalarExpression expr)
Description copied from class: ScalarExpression
Remainder Operator. The left-hand operand is the dividend and the right-hand operand is the divisor.

Overrides:
mod in class ScalarExpression
Parameters:
expr - the right-hand operator
Returns:
The binary % operator is said to yield the remainder of its operands from an implied division

mul

public ScalarExpression mul(ScalarExpression expr)
Description copied from class: ScalarExpression
Multiplication Operator

Overrides:
mul in class ScalarExpression
Parameters:
expr - the right-hand operator
Returns:
The binary * operator performs multiplication, producing the product of its operands.

sub

public ScalarExpression sub(ScalarExpression expr)
Description copied from class: ScalarExpression
Additive Operator. The binary - operator subtracts right-hand operand from left-hand operand.

Overrides:
sub in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
The binary - operator performs subtraction when applied to two operands of numeric type producing the difference of its operands; the left-hand operand is the minuend and the right-hand operand is the subtrahend.


Copyright © 2010. All Rights Reserved.