FileDocCategorySizeDatePackage
DivideNode.javaAPI DocGlassfish v2 API3478Tue May 22 16:54:36 BST 2007oracle.toplink.essentials.internal.parsing

DivideNode

public class DivideNode 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 DivideNode()

        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 .divide to the where clause returned from step 1 3. Generate the expression for the right side and use it as the parameter for the .divide() 4. Return the completed where clause to the caller

        Expression whereClause = getLeft().generateExpression(context);
        whereClause = ExpressionMath.divide(whereClause, getRight().generateExpression(context));
        return whereClause;
    
public booleanisDivideNode()

        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()));
        }