executor.startBatch(); //一定要有,通知开始批量 int batch = 0; for(TreeCate TreeCate:TreeCateList){ //调用获取sequence的方法。如果没有的话就去掉这行代码。 TreeCate.setTreeCateId(getNextId()); //参数世冲燃1为:ibatis中需要执行的语句的id ,参搜虚数2为要插入的数据 executor.insert("TreeCate_insertTreeCate", TreeCate); batch++; //每500条批量提交一次。判槐 if(batch==500){ executor.executeBatch(); batch = 0; } } executor.executeBatch(); //将最后的数据执行,最后不够500条的数据 return null; } }); }
标签:返回,ibatis,sqlmapExecutor
版权声明:文章由 知识百问 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.zhshbaiwen.com/answer/114977.html