1 21 package oracle.toplink.essentials.internal.parsing; 23 24 import oracle.toplink.essentials.queryframework.ObjectLevelReadQuery; 25 import oracle.toplink.essentials.queryframework.ReportQuery; 26 import oracle.toplink.essentials.expressions.Expression; 27 28 35 public class MinNode extends AggregateNode { 36 37 41 public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { 42 if (theQuery.isReportQuery()) { 43 ReportQuery reportQuery = (ReportQuery)theQuery; 44 reportQuery.addMinimum(resolveAttribute(), 45 getArgumentExpression(context)); 46 } 47 } 48 49 53 public void validate(ParseTreeContext context) { 54 if (left != null) { 55 left.validate(context); 56 setType(left.getType()); 57 } 58 } 59 60 64 public Expression generateExpression(GenerationContext context) { 65 return getArgumentExpression(context).minimum(); 66 } 67 68 72 public String getAsString() { 73 return "MIN(" + left.getAsString() + ")"; 74 } 75 } 76 | Popular Tags |