您的位置:首页 > 编程语言 > Java开发

我的异常处理笔记1-There is no getter for property named 'xx' in 'class java.lang.String'

2017-07-22 10:24 639 查看
There is no getter for property named ‘xx’ in ‘class java.lang.String’

当通过ssm实现筛选搜索时,出现以下错误。

我的功能需求是:通过传入前台页面用户输入的检索条件,后台进行查询。

前台页面:



mapper.xml文件代码:

<select id="findCar" resultType="com.bjsxt.pojo.Cars" >
SELECT * FROM cars
<where>
<if test="isRenting!='-1'">
and ISRENTING=#{isRenting}
</if>
</where>
</select>


mapper.Java的代码:

List<Cars> findCar(String isRenting);


所报异常:



解决:

查找自 http://www.mamicode.com/info-detail-962418.html

在mybatis mapper.java中,正常来说,单个参数或者实体传入,不需要加:@Param(“fundId”),但如果 mapper.xml中有

<if test=" fundId!=0">
and i.fundId = #{fundId}
</if>


这样的判断的话,就必须要在mapper.java中参数传入时加上:@Param(“fundId”)。

估计是因为 mapper.xml的配置信息必须要用注解的方式进行注入。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  异常处理
相关文章推荐