mybatis结果映射遇到的问题

错误如下:

org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.apache.ibatis.executor.ExecutorException: No constructor found in POJO.User matching [java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.String]
### The error may exist in Mapper/UserMapper
### The error may involve test.selectUserById
### The error occurred while handling results
### SQL: SELECT * FROM USER WHERE id=?
### Cause: org.apache.ibatis.executor.ExecutorException: No constructor found in POJO.User matching [java.lang.Integer, java.lang.String, java.lang.String, java.lang.String, java.lang.String]

最后,将User构造器中int改为Integer即可、

你可能感兴趣的:(mybati)