首页 > 编程语言 > 详细

传入mybatis的xml为Long型时报There is no getter for property named 'XXX' in 'class java.lang.

时间:2017-12-23 15:29:02      阅读:303      评论:0      收藏:0      [点我收藏+]

修改前

<select id="getGroupId" parameterType="java.lang.Long" resultType="com.capinfo.weibo.system.entity.ColumnGroup">
    SELECT * from common_columngroup c
    <where>
        <if test="accountId!=null">
            c.accountId=#{parameter} and c.type=2
       </if>
    </where>   
</select>

 

如果传入类型为Long类型,则参数需统一修改为[_parameter],修改后的sql语句如下(不管你的参数是什么,都要改成"_parameter")

<select id="getGroupId" parameterType="java.lang.Long" resultType="com.capinfo.weibo.system.entity.ColumnGroup">
    SELECT * from common_columngroup c
    <where>
        <if test="accountId!=null">
            c.accountId=#{_parameter} and c.type=2
       </if>
    </where>   
</select>

 

传入mybatis的xml为Long型时报There is no getter for property named 'XXX' in 'class java.lang.

原文:http://www.cnblogs.com/zqr99/p/8093359.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!