FileDocCategorySizeDatePackage
ExpressionNormalizer.javaAPI DocGlassfish v2 API5238Tue May 22 16:54:32 BST 2007oracle.toplink.essentials.internal.expressions

ExpressionNormalizer

public class ExpressionNormalizer extends Object
This is used during the normalization process to allow for a single main expression traversal.

Fields Summary
protected Expression
additionalExpression
A new root expression can be made from joins being added to the original expression.
protected SQLSelectStatement
statement
The statement being normalized.
protected Vector
subSelectExpressions
Subselect expressions found in the course of normalization.
protected AbstractSession
session
The session being normalized in.
Constructors Summary
public ExpressionNormalizer(SQLSelectStatement statement)

        this.statement = statement;
    
Methods Summary
public voidaddAdditionalExpression(oracle.toplink.essentials.expressions.Expression theExpression)

        // This change puts a null check into every call, but is printing additional
        // expressions in a meaningfull order worth it?
        additionalExpression = (additionalExpression == null) ? theExpression : additionalExpression.and(theExpression);
    
public voidaddSubSelectExpression(oracle.toplink.essentials.internal.expressions.SubSelectExpression subSelectExpression)
INTERNAL: Remember this subselect so that it can be normalized after the enclosing select statement is.

        if (subSelectExpressions == null) {
            subSelectExpressions = new Vector(1);
        }
        subSelectExpressions.add(subSelectExpression);
    
public booleanencounteredSubSelectExpressions()
INTERNAL: Were subselect expressions found while normalizing the selection criteria? Assumes underlying collection is initialized on first add.

        return (subSelectExpressions != null);
    
public oracle.toplink.essentials.expressions.ExpressiongetAdditionalExpression()

        return additionalExpression;
    
public oracle.toplink.essentials.internal.sessions.AbstractSessiongetSession()

        return session;
    
public oracle.toplink.essentials.internal.expressions.SQLSelectStatementgetStatement()

        return statement;
    
public voidnormalizeSubSelects(java.util.Dictionary clonedExpressions)
INTERNAL: Normalize all subselect expressions found in the course of normalizing the enclosing query. This method allows one to completely normalize the parent statement first (which should treat its sub selects as black boxes), and then normalize the subselects (which require full knowledge of the enclosing statement). This should make things clearer too, Assumes encounteredSubSelectExpressions() true. For CR#4223.

        for (Enumeration enumtr = subSelectExpressions.elements(); enumtr.hasMoreElements();) {
            SubSelectExpression next = (SubSelectExpression)enumtr.nextElement();
            next.normalizeSubSelect(this, clonedExpressions);
        }
    
public voidsetAdditionalExpression(oracle.toplink.essentials.expressions.Expression additionalExpression)

        this.additionalExpression = additionalExpression;
    
public voidsetSession(oracle.toplink.essentials.internal.sessions.AbstractSession session)

        this.session = session;
    
public voidsetStatement(oracle.toplink.essentials.internal.expressions.SQLSelectStatement statement)

        this.statement = statement;