关于mybatis批量插入的问题

tetty 2015-08-10 01:35:54
自己写的一个批量插入的方法
@Override
public void batchAdd(List<SnapshotDf> list) {
getSqlSession().insert(this.getClassName()+".batchAdd",list);
}
对应的map
<insert id="batchAdd" parameterType="java.util.List">
insert into snapshot_df(
link_id,
sid,
df_name,
df_storage,
df_used,
df_free,
df_usage,
df_mount,
record_time
)values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.linkId},
#{item.sid},
#{item.dfName},
#{item.dfStorage},
#{item.dfUsed},
#{item.dfFree},
#{item.dfUsage},
#{item.dfMount},
#{item.recordTime}
)
</foreach>
</insert>

可是为什么通过后台日志发现拼成的执行sql是
select count(1) from (insert into snapshot_df(...)...
为什么会多出select count(1) from这样一句呢?
...全文
66 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧