如何为ibatis sqltemplateclientmap创建自己的回调
题
我想知道如何创建自己的回调 SqlMapClientTemplate
. 。具体而言,我可以进行批次调用。
解决方案
我这样做的方式是覆盖 SqlMapClientCallback<T>
方法 doInSqlMapClient
.
SqlMapClientCallback<Integer> callback = new SqlMapClientCallback<Integer>() {
public Integer doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
executor.startBatch();
//... do your queries here
return executor.executeBatch();
}
};
不隶属于 StackOverflow