mybatis报invalue types()异常
mybatis报invalue types()错误
错误信息:
Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiating class cn.qd.mybatis.pojo.User with invalid types (Integer,String,String) .....
原因:
1) model中的get/set方法与成员变量不一致。
2) 构造函数被重载,构造方法的变量要写成对象类型模式。
3) 最好不要使用简单类型,如int, long等,改用对象模式Integer, Long等。