web123456

Spring+Mybatis Exception occurred while querying all data:: There is no getter for

When integrating Spring+Mybatis framework, data is queried according to conditions and an exception occurs

Caused by: : There is no getter for property named 'sname' in 'class '


document:

<select  parameterType="string" resultMap="userinfoMap">
		select * from userinfo where sname like '%${sname}%'
	</select>

UserinfoMapper interface:

public List<Userinfo> findAll(String sname);

Solution: Add @Param tag before the parameters

public List<Userinfo> findAll(@Param("sname") String sname);