| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
org.springframework.jdbc.support.JdbcAccessor | +--org.springframework.orm.ibatis.SqlMapTemplate
Helper class that simplifies data access via the MappedStatement API of the iBATIS Database Layer, and converts checked SQLExceptions into unchecked DataAccessExceptions, compatible to the org.springframework.dao exception hierarchy. Uses the same SQLExceptionTranslator mechanism as JdbcTemplate.
The main method is execute, taking the name of a mapped statement defined in the iBATIS SqlMap config file and a callback that implements a data access action on the specified statement.
This class provides numerous convenience methods that mirror MappedStatement's executeXXX methods. See the MappedStatement javadocs for details on those methods.
Constructor Summary | |
SqlMapTemplate() Create a new SqlMapTemplate. | |
SqlMapTemplate(DataSource dataSource, SqlMap sqlMap) Create a new SqlMapTemplate. |
Method Summary | |
Object | execute(String statementName, SqlMapCallback action) Execute the given data access action on the given mapped statement. |
List | executeQueryForList(String statementName, Object parameterObject) |
List | executeQueryForList(String statementName, Object parameterObject, int skipResults, int maxResults) |
Map | executeQueryForMap(String statementName, Object parameterObject, String keyProperty) |
Map | executeQueryForMap(String statementName, Object parameterObject, String keyProperty, String valueProperty) |
Object | executeQueryForObject(String statementName, Object parameterObject) |
Object | executeQueryForObject(String statementName, Object parameterObject, Object resultObject) |
void | executeQueryWithRowHandler(String statementName, Object parameterObject, RowHandler rowHandler) |
int | executeUpdate(String statementName, Object parameterObject) |
List | executeWithListResult(String statementName, SqlMapCallback action) Execute the given data access action on the given mapped statement, expecting a List result. |
Map | executeWithMapResult(String statementName, SqlMapCallback action) Execute the given data access action on the given mapped statement, expecting a Map result. |
SqlMap | getSqlMap() Return the iBATIS Database Layer SqlMap that this template works with. |
void | setSqlMap(SqlMap sqlMap) Set the iBATIS Database Layer SqlMap that defines the mapped statements. |
Methods inherited from class org.springframework.jdbc.support.JdbcAccessor |
afterPropertiesSet, getDataSource, getExceptionTranslator, setDataSource, setExceptionTranslator |
Constructor Detail |
public SqlMapTemplate()
public SqlMapTemplate(DataSource dataSource, SqlMap sqlMap)
Method Detail |
public Object execute(String statementName, SqlMapCallback action)
throws org.springframework.dao.DataAccessException
public List executeQueryForList(String statementName, Object parameterObject)
throws org.springframework.dao.DataAccessException
public List executeQueryForList(String statementName, Object parameterObject, int skipResults, int maxResults)
throws org.springframework.dao.DataAccessException
public Map executeQueryForMap(String statementName, Object parameterObject, String keyProperty)
throws org.springframework.dao.DataAccessException
public Map executeQueryForMap(String statementName, Object parameterObject, String keyProperty, String valueProperty)
throws org.springframework.dao.DataAccessException
public Object executeQueryForObject(String statementName, Object parameterObject)
throws org.springframework.dao.DataAccessException
public Object executeQueryForObject(String statementName, Object parameterObject, Object resultObject)
throws org.springframework.dao.DataAccessException
public void executeQueryWithRowHandler(String statementName, Object parameterObject, RowHandler rowHandler)
throws org.springframework.dao.DataAccessException
public int executeUpdate(String statementName, Object parameterObject)
throws org.springframework.dao.DataAccessException
public List executeWithListResult(String statementName, SqlMapCallback action)
throws org.springframework.dao.DataAccessException
public Map executeWithMapResult(String statementName, SqlMapCallback action)
throws org.springframework.dao.DataAccessException
public SqlMap getSqlMap()
public void setSqlMap(SqlMap sqlMap)
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |