mybatisplus坑 insert标签insert into select无参数问题
實(shí)際項(xiàng)目中發(fā)現(xiàn)
<insert id="xxx">
insert into xxxx select xxxx
</insert>
會(huì)報(bào)錯(cuò)
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.NullPointerException
### Cause: java.lang.NullPointerException
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
?
幾經(jīng)排查
com.baomidou.mybatisplus.processBatch方法
TableInfo tableInfo = TableInfoHelper.getTableInfo(parameterObject.getClass());
這里會(huì)取參數(shù)對(duì)象作為表信息,由于沒傳參數(shù),所以報(bào)錯(cuò)
?
改用<update>標(biāo)簽,問題解決
總結(jié)
以上是生活随笔為你收集整理的mybatisplus坑 insert标签insert into select无参数问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ESP分区简介
- 下一篇: 全套支付宝系统架构(内部架构图)【收藏】