|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.triactive.jdo.store.sql.expr.AbstractSqlExpression
com.triactive.jdo.store.sql.expr.BooleanExpression
com.triactive.jdo.store.sql.expr.SimulatedBooleanColumnExpression
public abstract class SimulatedBooleanColumnExpression
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.triactive.jdo.store.sql.expr.AbstractSqlExpression |
---|
AbstractSqlExpression.Body, AbstractSqlExpression.CompoundExpression, AbstractSqlExpression.SimpleColumnReference, AbstractSqlExpression.SubqueryExpression |
Field Summary | |
---|---|
protected SqlExpression |
qscExpr
|
protected boolean |
truthTest
|
Fields inherited from class com.triactive.jdo.store.sql.expr.AbstractSqlExpression |
---|
body, qs |
Constructor Summary | |
---|---|
protected |
SimulatedBooleanColumnExpression(SqlExpression qscExpr,
boolean truthTest,
SqlExpression falseValue)
|
Method Summary | |
---|---|
BooleanExpression |
eq(SqlExpression expr)
Returns a new expression representing "this == expr". |
boolean |
getTruthTest()
Represents the sense of the boolean expression. |
SqlExpression |
getUnderlyingColumn()
Returns an SQL expression representing an unadorned reference to the underlying non-boolean column. |
BooleanExpression |
not()
Returns a new expression representing "!this". |
BooleanExpression |
noteq(SqlExpression expr)
Returns a new expression representing "this != expr". |
int |
select()
Adds this expression to the list of those SELECTed in its surrounding query statement. |
Methods inherited from class com.triactive.jdo.store.sql.expr.BooleanExpression |
---|
and, eor, ior, protectOuterJoins, unprotectedOuterJoins, unprotectedOuterJoins |
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 |
Field Detail |
---|
protected final SqlExpression qscExpr
protected final boolean truthTest
Constructor Detail |
---|
protected SimulatedBooleanColumnExpression(SqlExpression qscExpr, boolean truthTest, SqlExpression falseValue)
Method Detail |
---|
public SqlExpression getUnderlyingColumn()
public final boolean getTruthTest()
true
if testing the column for boolean true,
false
if testing it for false (e.g. if the expression
has been negated).public int select()
SqlExpression
select
in interface SqlExpression
select
in class AbstractSqlExpression
public BooleanExpression eq(SqlExpression expr)
SqlExpression
eq
in interface SqlExpression
eq
in class BooleanExpression
expr
- The right-hand side of the operator.public BooleanExpression noteq(SqlExpression expr)
SqlExpression
noteq
in interface SqlExpression
noteq
in class BooleanExpression
expr
- The right-hand side of the operator.public BooleanExpression not()
not
in interface SqlExpression
not
in class BooleanExpression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |