|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.triactive.jdo.store.sql.expr.AbstractSqlExpression com.triactive.jdo.store.sql.expr.BooleanExpression
Nested Class Summary |
Nested classes inherited from class com.triactive.jdo.store.sql.expr.AbstractSqlExpression |
AbstractSqlExpression.Body, AbstractSqlExpression.CompoundExpression, AbstractSqlExpression.SimpleColumnReference, AbstractSqlExpression.SubqueryExpression |
Field Summary |
Fields inherited from class com.triactive.jdo.store.sql.expr.AbstractSqlExpression |
body, qs |
Constructor Summary | |
BooleanExpression(AbstractSqlExpression.Body body)
|
|
BooleanExpression(QueryStatement.QueryColumn qsc)
|
Method Summary | |
BooleanExpression |
and(SqlExpression expr)
Returns a new expression representing "this && expr". |
BooleanExpression |
eor(SqlExpression expr)
Returns a new expression representing "this ^ expr". |
BooleanExpression |
eq(SqlExpression expr)
Returns a new expression representing "this == expr". |
BooleanExpression |
ior(SqlExpression expr)
Returns a new expression representing "this || expr". |
BooleanExpression |
not()
Returns a new expression representing "!this". |
BooleanExpression |
noteq(SqlExpression expr)
Returns a new expression representing "this != expr". |
protected BooleanExpression |
protectOuterJoins()
Ensures that all columns referenced within this expression have been "protected" against exposure to OUTER JOIN-injected NULLs. |
protected java.util.Set |
unprotectedOuterJoins()
Returns the set of unprotected outer join columns for this expression. |
protected java.util.Set |
unprotectedOuterJoins(QueryStatement targetQs)
Returns the set of unprotected outer join columns for this expression. |
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, select, setMapping, sub, toStatementText, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BooleanExpression(AbstractSqlExpression.Body body)
public BooleanExpression(QueryStatement.QueryColumn qsc)
Method Detail |
public BooleanExpression and(SqlExpression expr)
SqlExpression
and
in interface SqlExpression
and
in class AbstractSqlExpression
public BooleanExpression eor(SqlExpression expr)
SqlExpression
eor
in interface SqlExpression
eor
in class AbstractSqlExpression
public BooleanExpression ior(SqlExpression expr)
SqlExpression
ior
in interface SqlExpression
ior
in class AbstractSqlExpression
public BooleanExpression not()
SqlExpression
not
in interface SqlExpression
not
in class AbstractSqlExpression
public BooleanExpression eq(SqlExpression expr)
SqlExpression
eq
in interface SqlExpression
eq
in class AbstractSqlExpression
public BooleanExpression noteq(SqlExpression expr)
SqlExpression
noteq
in interface SqlExpression
noteq
in class AbstractSqlExpression
protected final java.util.Set unprotectedOuterJoins()
and passingunprotectedOuterJoins(qs)
this.qs
as the query statement.
QueryStatement.QueryColumn
objects.unprotectedOuterJoins(QueryStatement)
protected java.util.Set unprotectedOuterJoins(QueryStatement targetQs)
"Unprotected" means that the expression has not yet been modified to test that the relevant outer join columns are not NULL.
The set of columns to be protected is defined by first considering all
columns referenced within the expression.
Of those, any whose table expressions
participated in an outer join might include rows with NULL values due to
the outer join.
We "protect" such references, i.e. ensure they are only exposed to actual
stored data and not rows with OUTER JOIN-injected NULLs, by testing that
all the columns on which the relevant table expressions were outer joined
are NOT NULL.
In other words, given an expression such as:
and assuming that the table expressions for MOTHER and FATHER were outer-joined on PERSON_ID, we say that the columns:MOTHER.FIRST_NAME = ? AND FATHER.FIRST_NAME = ?
are unprotected outer join columns for this expression. This example would beMOTHER.PERSON_ID FATHER.PERSON_ID
protected
by modifying
it to:
Strictly speaking this approach protects more column references than it needs to. For example, comparing FIRST_NAME to a string literal yields false anyway if FIRST_NAME is a NULL. But it's a simpler model to implement.MOTHER.PERSON_ID IS NOT NULL AND FATHER.PERSON_ID IS NOT NULL AND MOTHER.FIRST_NAME = ? AND FATHER.FIRST_NAME = ?
targetQs
- Consider only references to columns in this statement.
QueryStatement.QueryColumn
objects.protectOuterJoins()
protected BooleanExpression protectOuterJoins()
This is called at least:
unprotectedOuterJoins(QueryStatement)
,
AlternativesExpression
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |