構造方法忘記寫時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)
...


這是構造方法忘記寫時報的錯,雖然很基礎,但是不要初心大意。對於這種錯誤,應儘量避免,所謂的代碼質量就是從這些細節上提高的。

發佈了37 篇原創文章 · 獲贊 17 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章