Class MappedStatement

java.lang.Object
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement
Direct Known Subclasses:
CachingStatement, DeleteStatement, InsertStatement, ProcedureStatement, SelectStatement, UpdateStatement

public class MappedStatement extends Object
The Class MappedStatement.
  • Constructor Details

    • MappedStatement

      public MappedStatement()
  • Method Details

    • getStatementType

      public StatementType getStatementType()
      Gets the statement type.
      Returns:
      the statement type
    • executeUpdate

      public int executeUpdate(StatementScope statementScope, Transaction trans, Object parameterObject) throws SQLException
      Execute update.
      Parameters:
      statementScope - the statement scope
      trans - the trans
      parameterObject - the parameter object
      Returns:
      the int
      Throws:
      SQLException - the SQL exception
    • executeQueryForObject

      public Object executeQueryForObject(StatementScope statementScope, Transaction trans, Object parameterObject, Object resultObject) throws SQLException
      Execute query for object.
      Parameters:
      statementScope - the statement scope
      trans - the trans
      parameterObject - the parameter object
      resultObject - the result object
      Returns:
      the object
      Throws:
      SQLException - the SQL exception
    • executeQueryForList

      public List executeQueryForList(StatementScope statementScope, Transaction trans, Object parameterObject, int skipResults, int maxResults) throws SQLException
      Execute query for list.
      Parameters:
      statementScope - the statement scope
      trans - the trans
      parameterObject - the parameter object
      skipResults - the skip results
      maxResults - the max results
      Returns:
      the list
      Throws:
      SQLException - the SQL exception
    • executeQueryWithRowHandler

      public void executeQueryWithRowHandler(StatementScope statementScope, Transaction trans, Object parameterObject, RowHandler rowHandler) throws SQLException
      Execute query with row handler.
      Parameters:
      statementScope - the statement scope
      trans - the trans
      parameterObject - the parameter object
      rowHandler - the row handler
      Throws:
      SQLException - the SQL exception
    • executeQueryWithCallback

      protected void executeQueryWithCallback(StatementScope statementScope, Connection conn, Object parameterObject, Object resultObject, RowHandler rowHandler, int skipResults, int maxResults) throws SQLException
      Execute query with callback.
      Parameters:
      statementScope - the statement scope
      conn - the conn
      parameterObject - the parameter object
      resultObject - the result object
      rowHandler - the row handler
      skipResults - the skip results
      maxResults - the max results
      Throws:
      SQLException - the SQL exception
    • postProcessParameterObject

      protected void postProcessParameterObject(StatementScope statementScope, Object parameterObject, Object[] parameters)
      Post process parameter object.
      Parameters:
      statementScope - the statement scope
      parameterObject - the parameter object
      parameters - the parameters
    • sqlExecuteUpdate

      protected int sqlExecuteUpdate(StatementScope statementScope, Connection conn, String sqlString, Object[] parameters) throws SQLException
      Sql execute update.
      Parameters:
      statementScope - the statement scope
      conn - the conn
      sqlString - the sql string
      parameters - the parameters
      Returns:
      the int
      Throws:
      SQLException - the SQL exception
    • sqlExecuteQuery

      protected void sqlExecuteQuery(StatementScope statementScope, Connection conn, String sqlString, Object[] parameters, int skipResults, int maxResults, RowHandlerCallback callback) throws SQLException
      Sql execute query.
      Parameters:
      statementScope - the statement scope
      conn - the conn
      sqlString - the sql string
      parameters - the parameters
      skipResults - the skip results
      maxResults - the max results
      callback - the callback
      Throws:
      SQLException - the SQL exception
    • validateParameter

      protected Object validateParameter(Object param) throws SQLException
      Validate parameter.
      Parameters:
      param - the param
      Returns:
      the object
      Throws:
      SQLException - the SQL exception
    • getId

      public String getId()
      Gets the id.
      Returns:
      the id
    • getResultSetType

      public Integer getResultSetType()
      Gets the result set type.
      Returns:
      the result set type
    • setResultSetType

      public void setResultSetType(Integer resultSetType)
      Sets the result set type.
      Parameters:
      resultSetType - the new result set type
    • getFetchSize

      public Integer getFetchSize()
      Gets the fetch size.
      Returns:
      the fetch size
    • setFetchSize

      public void setFetchSize(Integer fetchSize)
      Sets the fetch size.
      Parameters:
      fetchSize - the new fetch size
    • setId

      public void setId(String id)
      Sets the id.
      Parameters:
      id - the new id
    • getSql

      public Sql getSql()
      Gets the sql.
      Returns:
      the sql
    • setSql

      public void setSql(Sql sql)
      Sets the sql.
      Parameters:
      sql - the new sql
    • getResultMap

      public ResultMap getResultMap()
      Gets the result map.
      Returns:
      the result map
    • setResultMap

      public void setResultMap(ResultMap resultMap)
      Sets the result map.
      Parameters:
      resultMap - the new result map
    • getParameterMap

      public ParameterMap getParameterMap()
      Gets the parameter map.
      Returns:
      the parameter map
    • setParameterMap

      public void setParameterMap(ParameterMap parameterMap)
      Sets the parameter map.
      Parameters:
      parameterMap - the new parameter map
    • getParameterClass

      public Class getParameterClass()
      Gets the parameter class.
      Returns:
      the parameter class
    • setParameterClass

      public void setParameterClass(Class parameterClass)
      Sets the parameter class.
      Parameters:
      parameterClass - the new parameter class
    • getResource

      public String getResource()
      Gets the resource.
      Returns:
      the resource
    • setResource

      public void setResource(String resource)
      Sets the resource.
      Parameters:
      resource - the new resource
    • getCacheKey

      public CacheKey getCacheKey(StatementScope statementScope, Object parameterObject)
      Gets the cache key.
      Parameters:
      statementScope - the statement scope
      parameterObject - the parameter object
      Returns:
      the cache key
    • setBaseCacheKey

      public void setBaseCacheKey(int base)
      Sets the base cache key.
      Parameters:
      base - the new base cache key
    • addExecuteListener

      public void addExecuteListener(ExecuteListener listener)
      Adds the execute listener.
      Parameters:
      listener - the listener
    • notifyListeners

      public void notifyListeners()
      Notify listeners.
    • getSqlExecutor

      public SqlExecutor getSqlExecutor()
      Gets the sql executor.
      Returns:
      the sql executor
    • getSqlMapClient

      public SqlMapClient getSqlMapClient()
      Gets the sql map client.
      Returns:
      the sql map client
    • setSqlMapClient

      public void setSqlMapClient(SqlMapClient sqlMapClient)
      Sets the sql map client.
      Parameters:
      sqlMapClient - the new sql map client
    • initRequest

      public void initRequest(StatementScope statementScope)
      Inits the request.
      Parameters:
      statementScope - the statement scope
    • getTimeout

      public Integer getTimeout()
      Gets the timeout.
      Returns:
      the timeout
    • setTimeout

      public void setTimeout(Integer timeout)
      Sets the timeout.
      Parameters:
      timeout - the new timeout
    • addResultMap

      public void addResultMap(ResultMap resultMap)
      Adds the result map.
      Parameters:
      resultMap - the result map
    • hasMultipleResultMaps

      public boolean hasMultipleResultMaps()
      Checks for multiple result maps.
      Returns:
      true, if successful
    • getAdditionalResultMaps

      public ResultMap[] getAdditionalResultMaps()
      Gets the additional result maps.
      Returns:
      the additional result maps