- All Implemented Interfaces:
- SqlExpression, StatementTextGenerator
- public class AlternativesExpression
- extends BooleanExpression
A series of two or more boolean expressions combined with OR.
BooleanExpression to OR together any pairs of subexpressions
(except for literals), with the result being that this expression is aware of
the entire chain of adjacent OR alternatives.
The purpose is to possibly reorder the subexpressions such that those which
share the same set of unprotected outer join references will be grouped
together and have
protectOuterJoins() called just once for each group.
In other words, given a JDOQL filter such as:
assuming "mother." and "father." require outer joins, then we can reorder the
alternative subexpressions before adding the "IS NOT NULL AND" to generate
more compact SQL:
"mother.firstName == n || father.firstName = n || mother.middleName == n || father.middleName == n"
MOTHER.PERSON_ID IS NOT NULL AND (MOTHER.FIRST_NAME = ? OR MOTHER.MIDDLE_NAME = ?) OR
FATHER.PERSON_ID IS NOT NULL AND (FATHER.FIRST_NAME = ? OR FATHER.MIDDLE_NAME = ?)
- 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, select, setMapping, sub, toStatementText, toString
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public AlternativesExpression(BooleanExpression operand1,
Copyright © 2001-2007 The TJDO Project All Rights Reserved.