com.triactive.jdo.store.sql.expr
Class SimulatedBooleanColumnExpression
java.lang.Object
com.triactive.jdo.store.sql.expr.AbstractSqlExpression
com.triactive.jdo.store.sql.expr.BooleanExpression
com.triactive.jdo.store.sql.expr.ComparisonExpression
com.triactive.jdo.store.sql.expr.SimulatedBooleanColumnExpression
- All Implemented Interfaces:
- SqlExpression, StatementTextGenerator
- Direct Known Subclasses:
- BooleanBitColumnExpression, BooleanCharColumnExpression
- public abstract class SimulatedBooleanColumnExpression
- extends com.triactive.jdo.store.sql.expr.ComparisonExpression
A boolean SQL expression referencing a database column that is treated as a
boolean but whose real SQL type is not boolean.
The column is restricted to one of two values used to represent true and
false.
When referencing the column we construct a larger expression that compares
the column with one of those two values.
The database effectively treats the comparison as boolean, at least in
certain contexts such as a WHERE clause.
- Author:
- Mike Martin
Methods inherited from class com.triactive.jdo.store.sql.expr.AbstractSqlExpression |
accessField, add, callMethod, cast, com, div, getColumnMapping, getJavaType, getMapping, getQueryStatement, getReferencedColumns, gt, gteq, innermostQuery, innermostQuery, lt, lteq, mod, mul, neg, newBody, newBody, newBody, newBody, newBody, newBody, newResultExpression, newSubqueryBody, setMapping, sub, toStatementText, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
qscExpr
protected final SqlExpression qscExpr
truthTest
protected final boolean truthTest
SimulatedBooleanColumnExpression
protected SimulatedBooleanColumnExpression(SqlExpression qscExpr,
boolean truthTest,
SqlExpression falseValue)
getUnderlyingColumn
public SqlExpression getUnderlyingColumn()
- Returns an SQL expression representing an unadorned reference to the
underlying non-boolean column.
getTruthTest
public final boolean getTruthTest()
- Represents the sense of the boolean expression.
- Returns:
true
if testing the column for boolean true,
false
if testing it for false (e.g. if the expression
has been negated).
select
public int select()
- Description copied from interface:
SqlExpression
- Adds this expression to the list of those SELECTed in its surrounding
query statement.
- Specified by:
select
in interface SqlExpression
- Overrides:
select
in class AbstractSqlExpression
eq
public BooleanExpression eq(SqlExpression expr)
- Description copied from interface:
SqlExpression
- Returns a new expression representing "this == expr".
- Specified by:
eq
in interface SqlExpression
- Overrides:
eq
in class BooleanExpression
noteq
public BooleanExpression noteq(SqlExpression expr)
- Description copied from interface:
SqlExpression
- Returns a new expression representing "this != expr".
- Specified by:
noteq
in interface SqlExpression
- Overrides:
noteq
in class BooleanExpression
not
public BooleanExpression not()
-
- Specified by:
not
in interface SqlExpression
- Overrides:
not
in class BooleanExpression
Copyright © 2001-2007 The TJDO Project All Rights Reserved.