|
From: <jue...@we...> - 2004-05-29 23:03:18
|
I've actually added the "queryWithRowHandler" method in the course of my =
changes today, and deprecated the "queryForList(..., RowHandler)" =
version. I've noticed the deprecation already at the time of SQL Maps =
2.0 RC4, but somehow forgot to adapt Spring's support classes =
immediately (although I promised to do it on the iBATIS forums).
=20
So if you fetch the DataSource/TransactionManager changes, you should =
get the "queryWithRowHandler" version too. Once we ship SQL Maps 2.0 =
final (probably in Spring 1.0.3?), I'll probably remove the =
"queryForList(..., RowHandler)" method entirely.
=20
Regarding SqlMapClientCallback: That's mainly used for implementing =
SqlMapClientTemplate's one-line operations. It's also available for =
applications, but the only scenario where I actually recommend this is =
statement batching: executor.startBatch, various operations, =
executor.executeBatch(). Such a batch needs to be executed on one single =
SqlMapExecutor, which SqlMapClientCallback provides.
=20
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Brandon Goodin
Gesendet: So 30.05.2004 01:53
An: spr...@li...
Betreff: RE: [Springframework-developer] Ibatis integration corrections =
needed
Sorry if this was received 2 or 3 times. I received a message email back =
2
times that said the last one I sent was too large. So, I felt it =
important
to post again.
Followin are some issues that need to be resolved...
Line 54 of SqlMapClientOperations:
List queryForList(String statementName, Object parameterObject, =
RowHandler
rowHandler)
throws DataAccessException;
=20
should be..
void queryWithRowhandler(String statementName, Object parameterObject,
RowHandler rowHandler)
throws DataAccessException;
=20
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
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|