Class MappedStatement
java.lang.Object
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement
- Direct Known Subclasses:
CachingStatement
,DeleteStatement
,InsertStatement
,ProcedureStatement
,SelectStatement
,UpdateStatement
The Class MappedStatement.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExecuteListener
(ExecuteListener listener) Adds the execute listener.void
addResultMap
(ResultMap resultMap) Adds the result map.executeQueryForList
(StatementScope statementScope, Transaction trans, Object parameterObject, int skipResults, int maxResults) Execute query for list.executeQueryForObject
(StatementScope statementScope, Transaction trans, Object parameterObject, Object resultObject) Execute query for object.protected void
executeQueryWithCallback
(StatementScope statementScope, Connection conn, Object parameterObject, Object resultObject, RowHandler rowHandler, int skipResults, int maxResults) Execute query with callback.void
executeQueryWithRowHandler
(StatementScope statementScope, Transaction trans, Object parameterObject, RowHandler rowHandler) Execute query with row handler.int
executeUpdate
(StatementScope statementScope, Transaction trans, Object parameterObject) Execute update.Gets the additional result maps.getCacheKey
(StatementScope statementScope, Object parameterObject) Gets the cache key.Gets the fetch size.getId()
Gets the id.Gets the parameter class.Gets the parameter map.Gets the resource.Gets the result map.Gets the result set type.getSql()
Gets the sql.Gets the sql executor.Gets the sql map client.Gets the statement type.Gets the timeout.boolean
Checks for multiple result maps.void
initRequest
(StatementScope statementScope) Inits the request.void
Notify listeners.protected void
postProcessParameterObject
(StatementScope statementScope, Object parameterObject, Object[] parameters) Post process parameter object.void
setBaseCacheKey
(int base) Sets the base cache key.void
setFetchSize
(Integer fetchSize) Sets the fetch size.void
Sets the id.void
setParameterClass
(Class parameterClass) Sets the parameter class.void
setParameterMap
(ParameterMap parameterMap) Sets the parameter map.void
setResource
(String resource) Sets the resource.void
setResultMap
(ResultMap resultMap) Sets the result map.void
setResultSetType
(Integer resultSetType) Sets the result set type.void
Sets the sql.void
setSqlMapClient
(SqlMapClient sqlMapClient) Sets the sql map client.void
setTimeout
(Integer timeout) Sets the timeout.protected void
sqlExecuteQuery
(StatementScope statementScope, Connection conn, String sqlString, Object[] parameters, int skipResults, int maxResults, RowHandlerCallback callback) Sql execute query.protected int
sqlExecuteUpdate
(StatementScope statementScope, Connection conn, String sqlString, Object[] parameters) Sql execute update.protected Object
validateParameter
(Object param) Validate parameter.
-
Constructor Details
-
MappedStatement
public MappedStatement()
-
-
Method Details
-
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 scopetrans
- the transparameterObject
- 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 scopetrans
- the transparameterObject
- the parameter objectresultObject
- 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 scopetrans
- the transparameterObject
- the parameter objectskipResults
- the skip resultsmaxResults
- 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 scopetrans
- the transparameterObject
- the parameter objectrowHandler
- 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 scopeconn
- the connparameterObject
- the parameter objectresultObject
- the result objectrowHandler
- the row handlerskipResults
- the skip resultsmaxResults
- 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 scopeparameterObject
- the parameter objectparameters
- the parameters
-
sqlExecuteUpdate
protected int sqlExecuteUpdate(StatementScope statementScope, Connection conn, String sqlString, Object[] parameters) throws SQLException Sql execute update.- Parameters:
statementScope
- the statement scopeconn
- the connsqlString
- the sql stringparameters
- 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 scopeconn
- the connsqlString
- the sql stringparameters
- the parametersskipResults
- the skip resultsmaxResults
- the max resultscallback
- the callback- Throws:
SQLException
- the SQL exception
-
validateParameter
Validate parameter.- Parameters:
param
- the param- Returns:
- the object
- Throws:
SQLException
- the SQL exception
-
getId
Gets the id.- Returns:
- the id
-
getResultSetType
Gets the result set type.- Returns:
- the result set type
-
setResultSetType
Sets the result set type.- Parameters:
resultSetType
- the new result set type
-
getFetchSize
Gets the fetch size.- Returns:
- the fetch size
-
setFetchSize
Sets the fetch size.- Parameters:
fetchSize
- the new fetch size
-
setId
Sets the id.- Parameters:
id
- the new id
-
getSql
Gets the sql.- Returns:
- the sql
-
setSql
Sets the sql.- Parameters:
sql
- the new sql
-
getResultMap
Gets the result map.- Returns:
- the result map
-
setResultMap
Sets the result map.- Parameters:
resultMap
- the new result map
-
getParameterMap
Gets the parameter map.- Returns:
- the parameter map
-
setParameterMap
Sets the parameter map.- Parameters:
parameterMap
- the new parameter map
-
getParameterClass
Gets the parameter class.- Returns:
- the parameter class
-
setParameterClass
Sets the parameter class.- Parameters:
parameterClass
- the new parameter class
-
getResource
Gets the resource.- Returns:
- the resource
-
setResource
Sets the resource.- Parameters:
resource
- the new resource
-
getCacheKey
Gets the cache key.- Parameters:
statementScope
- the statement scopeparameterObject
- 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
Adds the execute listener.- Parameters:
listener
- the listener
-
notifyListeners
public void notifyListeners()Notify listeners. -
getSqlExecutor
Gets the sql executor.- Returns:
- the sql executor
-
getSqlMapClient
Gets the sql map client.- Returns:
- the sql map client
-
setSqlMapClient
Sets the sql map client.- Parameters:
sqlMapClient
- the new sql map client
-
initRequest
Inits the request.- Parameters:
statementScope
- the statement scope
-
getTimeout
Gets the timeout.- Returns:
- the timeout
-
setTimeout
Sets the timeout.- Parameters:
timeout
- the new timeout
-
addResultMap
Adds the result map.- Parameters:
resultMap
- the result map
-
hasMultipleResultMaps
public boolean hasMultipleResultMaps()Checks for multiple result maps.- Returns:
- true, if successful
-
getAdditionalResultMaps
Gets the additional result maps.- Returns:
- the additional result maps
-