mybatis 为何我的id已经设置了主键自增,仍然报id不能为空? | 您所在的位置:网站首页 › 携程uid不能为空 › mybatis 为何我的id已经设置了主键自增,仍然报id不能为空? |
//上图是表信息 //控制台错误信息 ### Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: Column 'id' cannot be null ### The error may exist in com/dun/mapper/AccountMapper.java (best guess) ### The error may involve com.dun.mapper.AccountMapper.save-Inline ### The error occurred while setting parameters ### SQL: insert into accounts values(?,?,?) ### Cause: java.sql.SQLIntegrityConstraintViolationException: Column 'id' cannot be null ; Column 'id' cannot be null; nested exception is java.sql.SQLIntegrityConstraintViolationException: Column 'id' cannot be null //代码信息 public interface AccountMapper { @Insert("insert into accounts values(#{id},#{name},#{money})") public void save(Account account); @Select("select * from accounts") public List findAll(); } |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |