UserMapper.xml配置文件出现异常,主要异常如下
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'userName' of 'class com.company.Xxxx' with value '25' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'userName' in 'class com.company.Xxxx'
mapper接口是不是传递多个参数,如果是多个参数,在mapper接口上面添加@Param用来给传入参数命名。
如:
Admin findAdmin(@Param("username") String username, @Param("password") int password);
无法映射属性,看下数据库和实体映射是否正确,数据库如果下划线是否开启驼峰转换