zoukankan      html  css  js  c++  java
  • There is no getter for property named 'NULL' in ……

     往往细节上的错误事最要命的事情,当你看着代码,逻辑上没有问题,但是却又曝出一些莫名其妙不知所以的错,你百度了

    说出来的原因又是乱七八糟的鸡肋!很无助,纠结了很久,浪费了很多宝贵的时间……看代码!

    <update id="Updateuser2" parameterType="User">
            update 
            ckx_user
            <set>
                <if test="userName != NULL">
                    userName=#{userName},
                </if>
                <if test="passWord != NULL">
                    passWord=#{passWord}
                </if>
            </set>
            where 
            userId=#{userId}
        </update>

    看这段代码,一小段,加上错误提示,你应该可以悟得到!但是在码海你能在短时间发现,你厉害!

    没错!<if test="userName != NULL">我一直没看出来错误,userName != NULL,现在不是对空的判断了!而是是否等于NULL这个字符串

    太扯淡了!一直报错:Error updating database.  Cause: org.apache.ibatis.reflection.ReflectionException:

    他说错误的跟新数据!操蛋的人生不需要解释!看改后!

    <update id="Updateuser2" parameterType="User">
            update 
            ckx_user
            <set>
                <if test="userName != null">
                    userName=#{userName},
                </if>
                <if test="passWord != null">
                    passWord=#{passWord}
                </if>
            </set>
            where 
            userId=#{userId}
        </update>

    编译通过!运行正常!这是耽误了我一个晚上的事情。

  • 相关阅读:
    弹框定位
    多窗口切换
    frame嵌套页面元素的定位
    元素的等待
    键盘的操作
    鼠标的操作
    下拉列表框的选定定位
    Css定位元素
    依赖反射练习实例
    excel筛选两列值是否相同,如果相同返回第三列值
  • 原文地址:https://www.cnblogs.com/ckxlovejava/p/6063785.html
Copyright © 2011-2022 走看看