FileDocCategorySizeDatePackage
MultiplyNode.javaAPI DocGlassfish v2 API3494Tue May 22 16:54:38 BST 2007oracle.toplink.essentials.internal.parsing

MultiplyNode

public class MultiplyNode extends BinaryOperatorNode
INTERNAL

Purpose: Represent a '*' in EJBQL

Responsibilities:

  • Generate the correct expression for a '*'
author
Jon Driscoll and Joel Lucuik
since
July 2003

Fields Summary
Constructors Summary
public MultiplyNode()

        super();
    
Methods Summary
public oracle.toplink.essentials.expressions.ExpressiongenerateExpression(oracle.toplink.essentials.internal.parsing.GenerationContext context)
INTERNAL Generate the expression. The steps are: 1. Generate the expression for the left node 2. Add the .multiply to the where clause returned from step 1 3. Generate the expression for the right side and use it as the parameter for the .multiply() 4. Return the completed where clause to the caller

        Expression whereClause = getLeft().generateExpression(context);
        whereClause = ExpressionMath.multiply(whereClause, getRight().generateExpression(context));
        return whereClause;
    
public booleanisMultiplyNode()

        return true;
    
public voidvalidate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)
INTERNAL Validate node and calculates its type.

        super.validate(context);
        if ((left != null) && (right != null)) {
            TypeHelper typeHelper = context.getTypeHelper();
            setType(typeHelper.extendedBinaryNumericPromotion(
                        left.getType(), right.getType()));
        }