mybatisplus坑 insert标签insert into select无参数问题
實際項目中發現
<insert id="xxx">
insert into xxxx select xxxx
</insert>
會報錯
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)
?
幾經排查
com.baomidou.mybatisplus.processBatch方法
TableInfo tableInfo = TableInfoHelper.getTableInfo(parameterObject.getClass());
這里會取參數對象作為表信息,由于沒傳參數,所以報錯
?
改用<update>標簽,問題解決
總結
以上是生活随笔為你收集整理的mybatisplus坑 insert标签insert into select无参数问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ESP分区简介
- 下一篇: spring cloud gateway