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 MaxNode extends AggregateNode { 36 37 41 public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { 42 if (theQuery.isReportQuery()) { 43 ReportQuery reportQuery = (ReportQuery)theQuery; 44 reportQuery.addMaximum(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).maximum(); 66 } 67 68 72 public String getAsString() { 73 return "MAX(" + left.getAsString() + ")"; 74 } 75 } 76 | Popular Tags |