public boolean updateCheckRusultList(final List updateData) {
try{
getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
public Object doInSqlMapClient(SqlMapExecutor executor)
throws SQLException {
executor.startBatch();
for (Iterator i2=updateData.iterator(); i2.hasNext();){
SourceCodeCheckResult result = (SourceCodeCheckResult)i2.next() ;
logger.info("Update the reason and comment:Id-"+result.getLogId());
executor.update("SouceCodeCheckRule.updateCheckLog",result);
}
executor.executeBatch();
return null;
}
});
return true;
}catch(Exception e){
return false;
}
}
ibatis批量Update
最新推荐文章于 2021-02-23 17:29:41 发布
本文介绍了一种使用SqlMapClient批量更新数据库中检查结果的方法。通过迭代待更新的数据列表,并逐条执行更新操作,最终完成所有记录的状态更新。该方法利用了批处理功能提高数据库操作效率。
28万+

被折叠的 条评论
为什么被折叠?



