1 21 package oracle.toplink.essentials.internal.parsing; 23 24 import oracle.toplink.essentials.expressions.*; 25 26 35 public class DivideNode extends BinaryOperatorNode { 36 public DivideNode() { 37 super(); 38 } 39 40 44 public void validate(ParseTreeContext context) { 45 super.validate(context); 46 if ((left != null) && (right != null)) { 47 TypeHelper typeHelper = context.getTypeHelper(); 48 setType(typeHelper.extendedBinaryNumericPromotion( 49 left.getType(), right.getType())); 50 } 51 } 52 53 61 public Expression generateExpression(GenerationContext context) { 62 Expression whereClause = getLeft().generateExpression(context); 63 whereClause = ExpressionMath.divide(whereClause, getRight().generateExpression(context)); 64 return whereClause; 65 } 66 67 public boolean isDivideNode() { 68 return true; 69 } 70 } 71 | Popular Tags |