mybatisplus坑 insert标签insert into select无参数问题

实际项目中发现

insert into xxxx select xxxx

会报错

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());

这里会取参数对象作为表信息,由于没传参数,所以报错

 

改用标签,问题解决

你可能感兴趣的:(java)