构造方法忘记写时junit报错

org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: No constructor found in com.tszhao.dao.User matching [java.lang.Integer, java.lang.String, java.lang.Integer]
### The error may exist in com/tszhao/mapper/UserMapper.java (best guess)
### The error may involve com.tszhao.mapper.UserMapper.selectUser
### The error occurred while handling results
### SQL: select * from users where id=?
### Cause: org.apache.ibatis.executor.ExecutorException: No constructor found in com.tszhao.dao.User matching [java.lang.Integer, java.lang.String, java.lang.Integer]
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
...


这是构造方法忘记写时报的错,虽然很基础,但是不要初心大意。对于这种错误,应尽量避免,所谓的代码质量就是从这些细节上提高的。

原文地址:https://www.cnblogs.com/Z2978/p/12805922.html