应该怎么解决
用的是mybatis-plus自带的insert方法,driver中两个属性有值,所有字段,除了主键id都可以为空。driver的id为空,数据库id自增
serviceImpl中这句报错
int result = driverEntityMapper.insert(driver);
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
- Error updating database. Cause: java.lang.IllegalArgumentException: non null key required
- The error may exist in com/xxxx/mapper/DriverEntityMapper.java (best guess)
- The error may involve com.xxx.mapper.DriverEntityMapper.insert
- The error occurred while executing an update
- Cause: java.lang.IllegalArgumentException: non null key required