KickJava   Java API By Example, From Geeks To Geeks.

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


1 // $Id: Case2Node.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 a case ... when .. then ... else ... end expression in a select.
11  *
12  * @author Gavin King
13  */

14 public class Case2Node extends AbstractSelectExpression implements SelectExpression {
15     
16     public Type getDataType() {
17         return getFirstThenNode().getDataType();
18     }
19
20     private SelectExpression getFirstThenNode() {
21         return (SelectExpression) getFirstChild().getNextSibling().getFirstChild().getNextSibling();
22     }
23
24     public void setScalarColumnText(int i) throws SemanticException {
25         ColumnHelper.generateSingleScalarColumn( this, i );
26     }
27
28 }
29
Popular Tags