Spring+Mybatis 查询所有数据时发生异常:org.apache.ibatis.reflection.ReflectionException: There is no getter for

Spring+Mybatis框架整合时,根据条件查询数据,发生异常

Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'sname' in 'class java.lang.String'


userinfoMapper.xml文件:


UserinfoMapper接口:

public List findAll(String sname);

解决方法:在参数前加@Param标签

public List findAll(@Param("sname") String sname);



你可能感兴趣的:(mybatis)