1
// $Id: InsertStatement.java 7460 2005-07-12 20:27:29Z steveebersole $
2
package org.hibernate.hql.ast.tree;
4
import org.hibernate.QueryException;
5
import org.hibernate.hql.antlr.HqlSqlTokenTypes;
8
* Defines a top-level AST node representing an HQL "insert select" statement.
10
* @author Steve Ebersole
12
public class InsertStatement extends AbstractStatement {
15
* @see Statement#getStatementType()
17
public int getStatementType() {
18
return HqlSqlTokenTypes.INSERT;
22
* @see Statement#needsExecutor()
24
public boolean needsExecutor() {
29
* Performs detailed semantic validation on this insert statement tree.
31
* @throws QueryException Indicates validation failure.
33
public void validate() throws QueryException {
34
getIntoClause().validateTypes( getSelectClause() );
38
* Retreive this insert statement's into-clause.
40
* @return The into-clause
42
public IntoClause getIntoClause() {
43
return ( IntoClause ) getFirstChild();
47
* Retreive this insert statement's select-clause.
49
* @return The select-clause.
51
public SelectClause getSelectClause() {
52
return ( ( QueryNode ) getIntoClause().getNextSibling() ).getSelectClause();