There is no getter for property named...

错误信息

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'nul' in 'class com.qinsfu.param.AdminParam'

引起该错误的原因就是xml中的参数没有在你定义的Mapper的方法实数中找到属性的映射,至于我的引起原因如下:

<update id="update">
    update tb_admin
    <include refid="updatePart"/>
    <where>
        <choose>
            <when test="id != nul">id=#{id}</when>
            <otherwise>account=#{account}</otherwise>
        </choose>
    </where>
</update>

可以看到我把null打成了null,然后他误以为这个nul是在我的mapper中被提供的参数,然后他却没有在我的对应参数对象中找到对应nul属性的getter,也就是 There is no gettert for property named 'nul' in 'XXXX'.

原文地址:https://www.cnblogs.com/freesfu/p/13797162.html