mybatis 批量更新操作的一個坑

```

<update id="batchUpdateAlbumRecordContentIds" parameterType="java.util.List">
  <foreach collection="list" item="record" index="index" separator=";" open="" close="">
    update tb_album_record
    set
      content_id = #{record.contentId,jdbcType=BIGINT}
    where id = #{record.id,jdbcType=BIGINT}
  </foreach>
</update>

```

樓主在使用的時候一直報sql error的錯誤。找了很長時間。sql拼寫也沒錯,這時候一定要看下jdbc的配置文件

一定要加上

&allowMultiQueries=true
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章