1 21 package oracle.toplink.essentials.internal.parsing; 23 24 33 34 import oracle.toplink.essentials.expressions.Expression; 35 36 public abstract class AggregateNode extends Node { 37 38 private boolean distinct = false; 39 40 43 public String resolveAttribute() { 44 Node arg = getLeft(); 45 return arg.isDotNode() ? ((DotNode)arg).resolveAttribute() : null; 46 } 47 48 51 public Class resolveClass(GenerationContext context) { 52 return getLeft().resolveClass(context); 53 } 54 55 59 public boolean isAggregateNode() { 60 return true; 61 } 62 63 64 public boolean usesDistinct() { 65 return distinct; 66 } 67 68 69 public void setDistinct(boolean distinct) { 70 this.distinct = distinct; 71 } 72 73 74 protected Expression getArgumentExpression(GenerationContext context) { 75 Expression arg = getLeft().generateExpression(context); 76 if (usesDistinct()) { 77 arg = arg.distinct(); 78 } 79 return arg; 80 } 81 } 82 | Popular Tags |