org.datanucleus.store.rdbms.sql.expression
Class BooleanExpression

java.lang.Object
  extended by org.datanucleus.store.rdbms.sql.expression.SQLExpression
      extended by org.datanucleus.store.rdbms.sql.expression.BooleanExpression
Direct Known Subclasses:
BooleanLiteral, BooleanSubqueryExpression

public class BooleanExpression
extends SQLExpression

Representation of a Boolean expression in a Query. Can be represented in one of the following ways in the datastore


Nested Class Summary
 
Nested classes/interfaces inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
SQLExpression.ColumnExpressionList
 
Field Summary
 
Fields inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
isParameter, LOCALISER, lowestOperator, mapping, st, stmt, subExprs, table
 
Constructor Summary
BooleanExpression(org.datanucleus.query.expression.Expression.MonadicOperator op, SQLExpression expr1)
          Perform an operation
BooleanExpression(SQLExpression expr1, org.datanucleus.query.expression.Expression.DyadicOperator op, SQLExpression expr2)
          Perform an operation
BooleanExpression(SQLStatement stmt, SQLTable table, org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
          Constructor for a boolean expression for the specified mapping of the table.
 
Method Summary
 BooleanExpression and(SQLExpression expr)
          Conditional And.
 BooleanExpression eor(SQLExpression expr)
          Exclusive OR
 BooleanExpression eq(SQLExpression expr)
          Equality operator (equals to)
 BooleanExpression in(SQLExpression expr)
          In expression.
 SQLExpression invoke(java.lang.String methodName, java.util.List args)
          Invocation of a method on this expression.
 BooleanExpression ior(SQLExpression expr)
          Conditional OR.
 BooleanExpression ne(SQLExpression expr)
          Not equality operator (not equals to)
 BooleanExpression neg()
          Unary Minus Operator
 BooleanExpression not()
          Logical complement
 
Methods inherited from class org.datanucleus.store.rdbms.sql.expression.SQLExpression
add, cast, checkForAndCorrectParameterComparison, com, div, encloseInParentheses, ge, getJavaTypeMapping, getNumberOfSubExpressions, getSQLStatement, getSQLTable, gt, is, isParameter, le, lt, mod, mul, sub, toSQLText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanExpression

public BooleanExpression(SQLStatement stmt,
                         SQLTable table,
                         org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
Constructor for a boolean expression for the specified mapping of the table.

Parameters:
stmt - The statement
table - The table this mapping belongs to
mapping - the mapping associated to this expression

BooleanExpression

public BooleanExpression(org.datanucleus.query.expression.Expression.MonadicOperator op,
                         SQLExpression expr1)
Perform an operation
op
on expression
expr1
.

Parameters:
op - operator
expr1 - operand

BooleanExpression

public BooleanExpression(SQLExpression expr1,
                         org.datanucleus.query.expression.Expression.DyadicOperator op,
                         SQLExpression expr2)
Perform an operation
op
between
expr1
and
expr2
.

Parameters:
expr1 - the first expression
op - the operator between operands
expr2 - the second expression
Method Detail

and

public BooleanExpression and(SQLExpression expr)
Description copied from class: SQLExpression
Conditional And. Evaluates its right-hand operand only if the value of its left-hand operand is true.

Overrides:
and in class SQLExpression
Parameters:
expr - the right-hand operand
Returns:
the result value is true if both operand values are true; otherwise, the result is false.

eor

public BooleanExpression eor(SQLExpression expr)
Description copied from class: SQLExpression
Exclusive OR

Overrides:
eor in class SQLExpression
Parameters:
expr - the right-hand operand
Returns:
the result value is the bitwise exclusive OR of the operand values.

ior

public BooleanExpression ior(SQLExpression expr)
Description copied from class: SQLExpression
Conditional OR. Evaluates its right-hand operand only if the value of its left-hand operand is false.

Overrides:
ior in class SQLExpression
Parameters:
expr - the right-hand operand
Returns:
the result value is false if both operand values are false; otherwise, the result is true.

not

public BooleanExpression not()
Description copied from class: SQLExpression
Logical complement

Overrides:
not in class SQLExpression
Returns:
the result value is false if operand is true; otherwise, the result is true.

eq

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

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

ne

public BooleanExpression ne(SQLExpression expr)
Description copied from class: SQLExpression
Not equality operator (not equals to)

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

in

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

Overrides:
in in class SQLExpression
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.

invoke

public SQLExpression invoke(java.lang.String methodName,
                            java.util.List args)
Description copied from class: SQLExpression
Invocation of a method on this expression.

Overrides:
invoke in class SQLExpression
Parameters:
methodName - name of the method to invoke
args - Args to this method (if any)
Returns:
the converted value

neg

public BooleanExpression neg()
Description copied from class: SQLExpression
Unary Minus Operator

Overrides:
neg in class SQLExpression
Returns:
the type of the unary minus expression is the promoted type of the operand.


Copyright © 2009. All Rights Reserved.