KickJava   Java API By Example, From Geeks To Geeks.

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


1 // $Id: UpdateStatement.java,v 1.1 2005/07/12 20:27:17 steveebersole Exp $
2
package org.hibernate.hql.ast.tree;
3
4 import org.hibernate.hql.antlr.HqlSqlTokenTypes;
5 import org.hibernate.hql.antlr.SqlTokenTypes;
6 import org.hibernate.hql.ast.util.ASTUtil;
7
8 import antlr.collections.AST;
9
10 import org.apache.commons.logging.Log;
11 import org.apache.commons.logging.LogFactory;
12
13 /**
14  * Defines a top-level AST node representing an HQL update statement.
15  *
16  * @author Steve Ebersole
17  */

18 public class UpdateStatement extends AbstractRestrictableStatement {
19
20     private static final Log log = LogFactory.getLog( UpdateStatement.class );
21
22     /**
23      * @see org.hibernate.hql.ast.tree.Statement#getStatementType()
24      */

25     public int getStatementType() {
26         return SqlTokenTypes.UPDATE;
27     }
28
29     /**
30      * @see org.hibernate.hql.ast.tree.Statement#needsExecutor()
31      */

32     public boolean needsExecutor() {
33         return true;
34     }
35
36     protected int getWhereClauseParentTokenType() {
37         return SqlTokenTypes.SET;
38     }
39
40     protected Log getLog() {
41         return log;
42     }
43
44     public AST getSetClause() {
45         return ASTUtil.findTypeInChildren( this, HqlSqlTokenTypes.SET );
46     }
47 }
48
Popular Tags