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

MinusNode

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

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

        Expression whereClause = getLeft().generateExpression(context);
        whereClause = ExpressionMath.subtract(whereClause, getRight().generateExpression(context));
        return whereClause;
    
public booleanisMinusNode()

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