KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > hql > ast > tree > AggregateNode


1 // $Id: AggregateNode.java,v 1.1 2005/07/12 20:27:16 steveebersole Exp $
2
package org.hibernate.hql.ast.tree;
3
4 import org.hibernate.hql.ast.util.ColumnHelper;
5 import org.hibernate.type.Type;
6
7 import antlr.SemanticException;
8
9 /**
10  * Represents an aggregate function i.e. min, max, sum, avg.
11  *
12  * @author josh Sep 21, 2004 9:22:02 PM
13  */

14 public class AggregateNode extends AbstractSelectExpression implements SelectExpression {
15
16     public AggregateNode() {
17     }
18
19     public Type getDataType() {
20         // Get the function return value type, based on the type of the first argument.
21
return getSessionFactoryHelper().findFunctionReturnType( getText(), getFirstChild() );
22     }
23
24     public void setScalarColumnText(int i) throws SemanticException {
25         ColumnHelper.generateSingleScalarColumn( this, i );
26     }
27 }
28
Popular Tags