org.datanucleus.store.mapped.expression
Class BooleanCharColumnExpression

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

public class BooleanCharColumnExpression
extends BooleanExpression

Representation of a BooleanChar column expression.

Version:
$Revision: 1.10 $

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
BooleanCharColumnExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te)
          Constructor.
BooleanCharColumnExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te, boolean truthTest)
          Constructor.
 
Method Summary
 BooleanExpression eq(ScalarExpression expr)
          Equality operator (equals to)
 BooleanExpression in(ScalarExpression expr)
          In expression.
 BooleanExpression not()
          Logical complement
 BooleanExpression noteq(ScalarExpression expr)
          Equality operator (not equals to)
 StatementText toStatementText(int mode)
          StatementText representation of this expression.
 
Methods inherited from class org.datanucleus.store.mapped.expression.BooleanExpression
and, eor, ior, neg
 
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, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanCharColumnExpression

public BooleanCharColumnExpression(QueryExpression qs,
                                   JavaTypeMapping mapping,
                                   LogicSetExpression te)
Constructor. Perform a positive truth test("this = 1").

Parameters:
qs - the QueryExpression
mapping - the mapping associated to this expression
te - the TableExpression where this expression refers to

BooleanCharColumnExpression

public BooleanCharColumnExpression(QueryExpression qs,
                                   JavaTypeMapping mapping,
                                   LogicSetExpression te,
                                   boolean truthTest)
Constructor. Perform a truth test

Parameters:
qs - the QueryExpression
mapping - the mapping associated to this expression
te - the TableExpression where this expression refers to
truthTest - true for positive ("this = 1"), 0 for negative ("this = 0")
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.

eq

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

Overrides:
eq in class BooleanExpression
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 BooleanExpression
Parameters:
expr - the right-hand operand
Returns:
The type of an equality expression is a boolean

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

toStatementText

public StatementText toStatementText(int mode)
Description copied from class: ScalarExpression
StatementText representation of this expression. I.E. A Boolean field may be stored in boolean format like 0 or 1, and it can also be stored in other formats, like Y or N, TRUE or FALSE, and so on. The projection mode for the boolean field is the real content of the value stored, (e.g. Y or N), and opposed to that the filter mode for the boolean field is always represented by a boolean expression (e.g. Y=Y or N=N) In SQL, the projection can be exemplified as "SELECT BOOLEAN_FIELD ... " and the filter as "SELECT COLUMNS ... WHERE BOOLEAN_FIELD ='Y'"

Overrides:
toStatementText in class ScalarExpression
Parameters:
mode - (0=PROJECTION;1=FILTER)
Returns:
the StatementText


Copyright © 2010. All Rights Reserved.