|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ibatis.dao.client.template.DaoTemplate
com.ibatis.dao.client.template.SqlMapDaoTemplate
A DaoTemplate for SQL Map implementations that provides a convenient method to access the SqlMapExecutor. This class also provides SqlMapExecutor method wrappers that conveniently wrap SQLExceptions with DAO Exceptions.
| Field Summary |
| Fields inherited from class com.ibatis.dao.client.template.DaoTemplate |
daoManager |
| Constructor Summary | |
SqlMapDaoTemplate(DaoManager daoManager)
The DaoManager that manages this Dao instance will be passed in as the parameter to this constructor automatically upon instantiation. |
|
| Method Summary | |
int |
delete(java.lang.String id)
Executes a mapped SQL DELETE statement. |
int |
delete(java.lang.String id,
java.lang.Object parameterObject)
Executes a mapped SQL DELETE statement. |
int |
executeBatch()
Executes (flushes) all statements currently batched. |
java.util.List |
executeBatchDetailed()
Executes (flushes) all statements currently batched. |
protected SqlMapExecutor |
getSqlMapExecutor()
Gets the SQL Map Executor associated with the current DaoTransaction that this Dao is working under. |
protected SqlMapTransactionManager |
getSqlMapTransactionManager()
Gets the SQL Map Transaction Manager associated with the current DaoTransaction that this Dao is working under. |
java.lang.Object |
insert(java.lang.String id)
Executes a mapped SQL INSERT statement. |
java.lang.Object |
insert(java.lang.String id,
java.lang.Object parameterObject)
Executes a mapped SQL INSERT statement. |
java.util.List |
queryForList(java.lang.String id)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects. |
java.util.List |
queryForList(java.lang.String id,
int skip,
int max)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects within a certain range. |
java.util.List |
queryForList(java.lang.String id,
java.lang.Object parameterObject)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects. |
java.util.List |
queryForList(java.lang.String id,
java.lang.Object parameterObject,
int skip,
int max)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects within a certain range. |
java.util.Map |
queryForMap(java.lang.String id,
java.lang.Object parameterObject,
java.lang.String keyProp)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects that will be keyed into a Map. |
java.util.Map |
queryForMap(java.lang.String id,
java.lang.Object parameterObject,
java.lang.String keyProp,
java.lang.String valueProp)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects from which one property will be keyed into a Map. |
java.lang.Object |
queryForObject(java.lang.String id)
Executes a mapped SQL SELECT statement that returns data to populate a single object instance. |
java.lang.Object |
queryForObject(java.lang.String id,
java.lang.Object parameterObject)
Executes a mapped SQL SELECT statement that returns data to populate a single object instance. |
java.lang.Object |
queryForObject(java.lang.String id,
java.lang.Object parameterObject,
java.lang.Object resultObject)
Executes a mapped SQL SELECT statement that returns data to populate the supplied result object. |
PaginatedList |
queryForPaginatedList(java.lang.String id,
int pageSize)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects a page at a time. |
PaginatedList |
queryForPaginatedList(java.lang.String id,
java.lang.Object parameterObject,
int pageSize)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects a page at a time. |
void |
queryWithRowHandler(java.lang.String id,
java.lang.Object parameterObject,
RowHandler rowHandler)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects that will be handled one at a time by a RowHandler. |
void |
queryWithRowHandler(java.lang.String id,
RowHandler rowHandler)
Executes a mapped SQL SELECT statement that returns data to populate a number of result objects that will be handled one at a time by a RowHandler. |
void |
startBatch()
Starts a batch in which update statements will be cached before being sent to the database all at once. |
int |
update(java.lang.String id)
Executes a mapped SQL UPDATE statement. |
int |
update(java.lang.String id,
java.lang.Object parameterObject)
Executes a mapped SQL UPDATE statement. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SqlMapDaoTemplate(DaoManager daoManager)
daoManager - | Method Detail |
protected SqlMapExecutor getSqlMapExecutor()
protected SqlMapTransactionManager getSqlMapTransactionManager()
public java.lang.Object insert(java.lang.String id,
java.lang.Object parameterObject)
insert in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).
public java.lang.Object insert(java.lang.String id)
insert in interface SqlMapExecutorid - The name of the statement to execute.
public int update(java.lang.String id,
java.lang.Object parameterObject)
update in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).
public int update(java.lang.String id)
update in interface SqlMapExecutorid - The name of the statement to execute.
public int delete(java.lang.String id,
java.lang.Object parameterObject)
delete in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).
public int delete(java.lang.String id)
delete in interface SqlMapExecutorid - The name of the statement to execute.
public java.lang.Object queryForObject(java.lang.String id,
java.lang.Object parameterObject)
queryForObject in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).
public java.lang.Object queryForObject(java.lang.String id)
queryForObject in interface SqlMapExecutorid - The name of the statement to execute.
public java.lang.Object queryForObject(java.lang.String id,
java.lang.Object parameterObject,
java.lang.Object resultObject)
queryForObject in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).resultObject - The result object instance that should be populated with result data.
public java.util.List queryForList(java.lang.String id,
java.lang.Object parameterObject)
queryForList in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).
public java.util.List queryForList(java.lang.String id)
queryForList in interface SqlMapExecutorid - The name of the statement to execute.
public java.util.List queryForList(java.lang.String id,
java.lang.Object parameterObject,
int skip,
int max)
queryForList in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).skip - The number of results to ignore.max - The maximum number of results to return.
public java.util.List queryForList(java.lang.String id,
int skip,
int max)
queryForList in interface SqlMapExecutorid - The name of the statement to execute.skip - The number of results to ignore.max - The maximum number of results to return.
public void queryWithRowHandler(java.lang.String id,
java.lang.Object parameterObject,
RowHandler rowHandler)
queryWithRowHandler in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).rowHandler - A RowHandler instance
public void queryWithRowHandler(java.lang.String id,
RowHandler rowHandler)
queryWithRowHandler in interface SqlMapExecutorid - The name of the statement to execute.rowHandler - A RowHandler instance
public PaginatedList queryForPaginatedList(java.lang.String id,
java.lang.Object parameterObject,
int pageSize)
queryForPaginatedList in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).pageSize - The maximum number of result objects each page can hold.
public PaginatedList queryForPaginatedList(java.lang.String id,
int pageSize)
queryForPaginatedList in interface SqlMapExecutorid - The name of the statement to execute.pageSize - The maximum number of result objects each page can hold.
public java.util.Map queryForMap(java.lang.String id,
java.lang.Object parameterObject,
java.lang.String keyProp)
queryForMap in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).keyProp - The property to be used as the key in the Map.
public java.util.Map queryForMap(java.lang.String id,
java.lang.Object parameterObject,
java.lang.String keyProp,
java.lang.String valueProp)
queryForMap in interface SqlMapExecutorid - The name of the statement to execute.parameterObject - The parameter object (e.g. JavaBean, Map, XML etc.).keyProp - The property to be used as the key in the Map.valueProp - The property to be used as the value in the Map.
public void startBatch()
startBatch in interface SqlMapExecutorpublic int executeBatch()
executeBatch in interface SqlMapExecutorpublic java.util.List executeBatchDetailed()
executeBatchDetailed in interface SqlMapExecutorBatchException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||