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

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

<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>

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

There is no getter for property named 'NULL' in ……的更多相关文章

  1. There is no getter for property named 'purchaseApplyId' in 'class java.lang.Long'

    mapper.xml: <delete id="deleteByPurchaseAppyId" parameterType="Long"> < ...

  2. MyBatis3: There is no getter for property named 'code' in 'class java.lang.String'

    mybatis3  : mysql文如下,传入参数为string类型时‘preCode’,运行报错为:There is no getter for property named 'preCode' i ...

  3. mybatis There is no getter for property named 'xx' in 'class java.lang.String

    转载自://http://www.cnblogs.com/anee/p/3324140.html 用mybatis查询时,传入一个字符串传参数,且进行判断时,会报 There is no getter ...

  4. Mybatis问题:There is no getter for property named 'unitId' in 'class java.lang.String'

    Mybatis遇到的问题 问题: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.re ...

  5. 【MyBatis学习06】_parameter:解决There is no getter for property named in class java.lang.String

    我们知道在mybatis的映射中传参数,只能传入一个.通过#{参数名} 即可获取传入的值. Mapper接口文件: public int delete(int id) throws Exception ...

  6. SSM框架报错分析(一)——There is no getter for property named 'XXX' in 'class java.lang.String'

    一.发现问题 <select id="queryStudentByNum" resultType="student" parameterType=&quo ...

  7. Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'zoneId' in 'class java.lang.String'

    本文为博主原创,未经允许不得而转载: 异常展示: dao层定义的接口为: public int getClientTotal(); 在mybatis中的sql为: <select id=&quo ...

  8. There is no getter for property named 'notice' in 'class com.game.domain.Notices'

    在插入数据时报错:There is no getter for property named 'notice' in 'class com.game.domain.Notices' 四月 11, 20 ...

  9. 关于myBatis的问题There is no getter for property named 'USER_NAME' in 'class com.bky.model.实例类'

    现在流行的 ssm(spring + struts2 + myBatis)  持久层的mybatis是需要配置映射器的,找了个demo连接的数据库是MySQL 于是就修改了一下弄成了连接Oracle的 ...

随机推荐

  1. asp.net使用My97 Date Picker时设置默认起始时间为n年之前的今天

    可以使用My97 Date Picker组件来收集用户输入的日期值. 首先下载该组件:http://www.my97.net/dp/index.asp放到自己的项目中. 然后在项目里面引用js和css ...

  2. Python for loop and while loop

    #!pyton2 #-*- coding:utf-8 -*- for letter in "Python": print "Current letter is:" ...

  3. 【netty】Netty系列之Netty百万级推送服务设计要点

    1. 背景 1.1. 话题来源 最近很多从事移动互联网和物联网开发的同学给我发邮件或者微博私信我,咨询推送服务相关的问题.问题五花八门,在帮助大家答疑解惑的过程中,我也对问题进行了总结,大概可以归纳为 ...

  4. IntelliJ IDEA热加载自动更新(Update classes and resources )

          IntelliJ IDEA默认文件是自动保存的,但是手头有个项目jsp文件改动后,在tomcat中不能立即响应变化.想要jsp文件改动后立刻看到变化,可以通过修改配置来实现.       ...

  5. 安装android studio

    sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 sudo apt-get install g++-multil ...

  6. Capture a Screen Shot

    using System; using System.Runtime.InteropServices; using System.Drawing; using System.Drawing.Imagi ...

  7. 【解决】SharePoint外部列表保存的日期/时间值不正确

    [问题描述]: 在SharePoint中创建一个外部列表后,通过工作流或直接通过外部列表中的新增向外部列表添加数据项.通过外部列表或数据库查看添加的数据项时发现日期类型字段的值都不正确,像是差了若干个 ...

  8. set JAVA_HOME in RHEL/CentOS

    3.3. Install OpenJDK on Red Hat Enterprise Linux Introduction OpenJDK is one of many Java Developmen ...

  9. shell基础

    1.显示当前登录linux系统的用户 2.当用户登录到linux系统后,一旦出现提示符时,便可以输入操作命令了.命令可以分为如下两类: (1).bash内置的命令: (2).应用程序. 怎么知道哪些指 ...

  10. 页面打开 抛出w3wp.exe 中发生未处理异常

    页面打开 抛出w3wp.exe 中发生未处理异常