1 16 package com.ibatis.sqlmap.engine.mapping.statement; 17 18 import com.ibatis.sqlmap.client.event.RowHandler; 19 import com.ibatis.sqlmap.engine.scope.RequestScope; 20 import com.ibatis.sqlmap.engine.transaction.Transaction; 21 22 import java.sql.SQLException ; 23 import java.util.List ; 24 25 public class InsertStatement extends GeneralStatement { 26 27 private SelectKeyStatement selectKeyStatement; 28 29 public StatementType getStatementType() { 30 return StatementType.INSERT; 31 } 32 33 public Object executeQueryForObject(RequestScope request, Transaction trans, Object parameterObject, Object resultObject) 34 throws SQLException { 35 throw new SQLException ("Insert statements cannot be executed as a query."); 36 } 37 38 public List executeQueryForList(RequestScope request, Transaction trans, Object parameterObject, int skipResults, int maxResults) 39 throws SQLException { 40 throw new SQLException ("Insert statements cannot be executed as a query."); 41 } 42 43 public void executeQueryWithRowHandler(RequestScope request, Transaction trans, Object parameterObject, RowHandler rowHandler) 44 throws SQLException { 45 throw new SQLException ("Update statements cannot be executed as a query."); 46 } 47 48 public SelectKeyStatement getSelectKeyStatement() { 49 return selectKeyStatement; 50 } 51 52 public void setSelectKeyStatement(SelectKeyStatement selectKeyStatement) { 53 this.selectKeyStatement = selectKeyStatement; 54 } 55 } 56 | Popular Tags |