KickJava   Java API By Example, From Geeks To Geeks.

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


1 // $Id: AbstractSelectExpression.java,v 1.1 2005/07/12 20:27:16 steveebersole Exp $
2
package org.hibernate.hql.ast.tree;
3
4 import org.hibernate.type.Type;
5
6 import antlr.SemanticException;
7
8 /**
9  * Partial implementation of SelectExpression for all the nodes that aren't constructors.
10  *
11  * @author josh Nov 11, 2004 7:09:11 AM
12  */

13 public abstract class AbstractSelectExpression extends HqlSqlWalkerNode implements SelectExpression {
14     
15     private String JavaDoc alias;
16     
17     public final void setAlias(String JavaDoc alias) {
18         this.alias = alias;
19     }
20     
21     public final String JavaDoc getAlias() {
22         return alias;
23     }
24
25     public boolean isConstructor() {
26         return false;
27     }
28
29     public boolean isReturnableEntity() throws SemanticException {
30         return false;
31     }
32
33     public FromElement getFromElement() {
34         return null;
35     }
36
37     public boolean isScalar() throws SemanticException {
38         // Default implementation:
39
// If this node has a data type, and that data type is not an association, then this is scalar.
40
Type type = getDataType();
41         return type != null && !type.isAssociationType(); // Moved here from SelectClause [jsd]
42
}
43 }
44
Popular Tags