~ubuntu-branches/ubuntu/wily/libhibernate3-java/wily-proposed

« back to all changes in this revision

Viewing changes to src/org/hibernate/hql/ast/tree/InsertStatement.java

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-10-14 14:43:34 UTC
  • Revision ID: james.westby@ubuntu.com-20071014144334-eamc8i0q10gs1aro
Tags: upstream-3.2.5
ImportĀ upstreamĀ versionĀ 3.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// $Id: InsertStatement.java 7460 2005-07-12 20:27:29Z steveebersole $
 
2
package org.hibernate.hql.ast.tree;
 
3
 
 
4
import org.hibernate.QueryException;
 
5
import org.hibernate.hql.antlr.HqlSqlTokenTypes;
 
6
 
 
7
/**
 
8
 * Defines a top-level AST node representing an HQL "insert select" statement.
 
9
 *
 
10
 * @author Steve Ebersole
 
11
 */
 
12
public class InsertStatement extends AbstractStatement {
 
13
 
 
14
        /**
 
15
         * @see Statement#getStatementType()
 
16
         */
 
17
        public int getStatementType() {
 
18
                return HqlSqlTokenTypes.INSERT;
 
19
        }
 
20
 
 
21
        /**
 
22
         * @see Statement#needsExecutor()
 
23
         */
 
24
        public boolean needsExecutor() {
 
25
                return true;
 
26
        }
 
27
 
 
28
        /**
 
29
         * Performs detailed semantic validation on this insert statement tree.
 
30
         *
 
31
         * @throws QueryException Indicates validation failure.
 
32
         */
 
33
        public void validate() throws QueryException {
 
34
                getIntoClause().validateTypes( getSelectClause() );
 
35
        }
 
36
 
 
37
        /**
 
38
         * Retreive this insert statement's into-clause.
 
39
         *
 
40
         * @return The into-clause
 
41
         */
 
42
        public IntoClause getIntoClause() {
 
43
                return ( IntoClause ) getFirstChild();
 
44
        }
 
45
 
 
46
        /**
 
47
         * Retreive this insert statement's select-clause.
 
48
         *
 
49
         * @return The select-clause.
 
50
         */
 
51
        public SelectClause getSelectClause() {
 
52
                return ( ( QueryNode ) getIntoClause().getNextSibling() ).getSelectClause();
 
53
        }
 
54
 
 
55
}