1 21 package oracle.toplink.essentials.internal.parsing; 23 24 import oracle.toplink.essentials.expressions.*; 25 import oracle.toplink.essentials.internal.expressions.ConstantExpression; 26 27 34 public class UnaryMinus extends Node { 35 36 public UnaryMinus() { 37 super(); 38 } 39 40 44 public void validate(ParseTreeContext context) { 45 if (left != null) { 46 left.validate(context); 47 setType(left.getType()); 48 } 49 } 50 51 54 public void validateParameter(ParseTreeContext context, Object contextType) { 55 left.validateParameter(context, contextType); 57 } 58 59 63 public Expression generateExpression(GenerationContext context) { 64 Expression whereClause = new ConstantExpression(new Integer (0), new ExpressionBuilder()); 65 whereClause = ExpressionMath.subtract(whereClause, getLeft().generateExpression(context)); 66 return whereClause; 67 } 68 69 } 70 | Popular Tags |