mybatis整合Spring项目,报There is no getter for property named '***' in 'class java.lang.String错误java
由于mybatis版本的问题,有些传入参数不支持直接设置bean的名称,若是parameterType="java.lang.String"传入参数为String类型报了上述错误,则语句中必须将参数名称统一换成_parameter:mybatis
原句:code
<if test="productId != null and productId != ''"> AND product.PRODUCT_ID = #{productId, jdbcType=VARCHAR} </if>
改成:get
<if test="_parameter != null and _parameter != ''"> AND product.PRODUCT_ID = #{productId, jdbcType=VARCHAR} </if>