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

java.lang.Object
  extended by org.datanucleus.store.rdbms.sql.expression.SQLExpression
      extended by org.datanucleus.store.rdbms.sql.expression.BooleanExpression
          extended by org.datanucleus.store.rdbms.sql.expression.BooleanLiteral
All Implemented Interfaces:
SQLLiteral

public class BooleanLiteral
extends BooleanExpression
implements SQLLiteral

Representation of a Boolean literal in a Query.


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
BooleanLiteral(SQLStatement stmt, org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping, java.lang.Object value, boolean parameter)
          Creates a boolean literal with the specified value, using the provided mapping.
 
Method Summary
 BooleanExpression and(SQLExpression expr)
          Conditional And.
 BooleanExpression eor(SQLExpression expr)
          Exclusive OR
 BooleanExpression eq(SQLExpression expr)
          Equality operator (equals to)
 java.lang.Object getValue()
          Accessor to the literal value
 BooleanExpression ior(SQLExpression expr)
          Conditional OR.
 BooleanExpression ne(SQLExpression expr)
          Not equality operator (not equals to)
 BooleanExpression not()
          Logical complement
 void setNotParameter()
          Method to set this literal as not being a parameter.
protected  void setStatement()
           
 
Methods inherited from class org.datanucleus.store.rdbms.sql.expression.BooleanExpression
in, invoke, neg
 
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

BooleanLiteral

public BooleanLiteral(SQLStatement stmt,
                      org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
                      java.lang.Object value,
                      boolean parameter)
Creates a boolean literal with the specified value, using the provided mapping.

Parameters:
stmt - The SQL statement
mapping - the mapping
value - the value
parameter - Whether this is a parameter (JDBC "?")
Method Detail

getValue

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

Specified by:
getValue in interface SQLLiteral
Returns:
the value of the literal

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

setNotParameter

public void setNotParameter()
Description copied from interface: SQLLiteral
Method to set this literal as not being a parameter. If the literal if not currently a parameter then does nothing. Updates any underlying SQL to have the value.

Specified by:
setNotParameter in interface SQLLiteral

setStatement

protected void setStatement()


Copyright © 2009. All Rights Reserved.