/** * INTERNAL * Apply this node to the passed query */ public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { if (theQuery.isReportQuery()) { ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.addAttribute("minus", generateExpression(context), (Class)getType()); } }
/** * 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 */ public Expression generateExpression(GenerationContext context) { Expression whereClause = getLeft().generateExpression(context); whereClause = ExpressionMath.subtract(whereClause, getRight().generateExpression(context)); return whereClause; }
/** * INTERNAL * Validate node and calculates its type. */ public void validate(ParseTreeContext context) { super.validate(context); if ((left != null) && (right != null)) { TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.extendedBinaryNumericPromotion( left.getType(), right.getType())); } }
/** * 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 */ public Expression generateExpression(GenerationContext context) { Expression whereClause = getLeft().generateExpression(context); whereClause = ExpressionMath.subtract(whereClause, getRight().generateExpression(context)); return whereClause; }
/** * INTERNAL * Validate node and calculates its type. */ public void validate(ParseTreeContext context) { super.validate(context); if ((left != null) && (right != null)) { TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.extendedBinaryNumericPromotion( left.getType(), right.getType())); } }
/** * INTERNAL * Apply this node to the passed query */ public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { if (theQuery.isReportQuery()) { ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.addAttribute("minus", generateExpression(context), (Class)getType()); } }
/** * 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 */ public Expression generateExpression(GenerationContext context) { Expression whereClause = getLeft().generateExpression(context); whereClause = ExpressionMath.subtract(whereClause, getRight().generateExpression(context)); return whereClause; }
/** * INTERNAL * Validate node and calculates its type. */ public void validate(ParseTreeContext context) { super.validate(context); if ((left != null) && (right != null)) { TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.extendedBinaryNumericPromotion( left.getType(), right.getType())); } }
/** * INTERNAL * Apply this node to the passed query */ public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { if (theQuery.isReportQuery()) { ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.addAttribute("minus", generateExpression(context), (Class)getType()); } }