|
From: Brandon G. <ma...@ph...> - 2004-05-29 22:39:55
|
Sorry if this was received twice. I received a message email back that said
the last one I sent was too large. So, I felt it important to post again.
I know I should be adding these to a bug report. But, I figured that I could
do it all in one bug report once the more complex issue of transaction
management is resolved.
I have found another issue that needs to be remedied.
Line 54 of SqlMapClientOpertaions:
List queryForList(String statementName, Object parameterObject, RowHandler
rowHandler)
throws DataAccessException;
should be..
void queryWithRowhandler(String statementName, Object parameterObject,
RowHandler rowHandler)
throws DataAccessException;
Line 185-192 of SqlMapClientTemplate needs to be changed in a similar
manner:
public List queryForList(final String statementName, final Object
parameterObject,
final RowHandler rowHandler) throws DataAccessException {
return executeWithListResult(new SqlMapClientCallback() {
public Object doInSqlMapClient(SqlMapExecutor executor) throws
SQLException {
return executor.queryForList(statementName,
parameterObject, rowHandler);
}
});
}
Should be:
I am assuming you do not want to implement another method on your
SqlMapClientCallback just to accommodate the queryWithRowHandler. So, I
simply pass back a null from the doInSqlMapClient of the
SqlMapClientCallback implementation and ignore it.
public void queryWithRowHandler(final String statementName, final Object
parameterObject,
final RowHandler rowHandler) throws DataAccessException {
executeWithRowHandler(new SqlMapClientCallback() {
public Object doInSqlMapClient(SqlMapExecutor executor) throws
SQLException {
executor.queryWithRowHandler(statementName,
parameterObject, rowHandler);
return null;
}
});
}
Also, the following should be added to the SqlMapClientTemplate
/**
* Execute the given data access action on a SqlMapSession
* with a RowHandler.
* @param action callback object that specifies the data access action
* @return the List result
* @throws DataAccessException in case of SQL Maps errors
*/
public void executeWithRowHandler(SqlMapClientCallback action) throws
DataAccessException {
execute(action);
}
Apart from all of this I am rather curious about the purpose the
SqlMapClientCallback? I read the javadoc and am wondering what role it plays
in the process of Spring integration with iBatis. Could you provide me with
a explanation of it's role?
Thanks,
Brandon Goodin
http://www.ibatis.com
|