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>
编译通过!运行正常!这是耽误了我一个晚上的事情。
There is no getter for property named 'NULL' in ……的更多相关文章
- There is no getter for property named 'purchaseApplyId' in 'class java.lang.Long'
mapper.xml: <delete id="deleteByPurchaseAppyId" parameterType="Long"> < ...
- 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 ...
- 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 ...
- 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 ...
- 【MyBatis学习06】_parameter:解决There is no getter for property named in class java.lang.String
我们知道在mybatis的映射中传参数,只能传入一个.通过#{参数名} 即可获取传入的值. Mapper接口文件: public int delete(int id) throws Exception ...
- SSM框架报错分析(一)——There is no getter for property named 'XXX' in 'class java.lang.String'
一.发现问题 <select id="queryStudentByNum" resultType="student" parameterType=&quo ...
- 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 ...
- 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 ...
- 关于myBatis的问题There is no getter for property named 'USER_NAME' in 'class com.bky.model.实例类'
现在流行的 ssm(spring + struts2 + myBatis) 持久层的mybatis是需要配置映射器的,找了个demo连接的数据库是MySQL 于是就修改了一下弄成了连接Oracle的 ...
随机推荐
- 传递引用类型参数的两种方式(转自 MSDN)
引用类型的变量不直接包含其数据:它包含的是对其数据的引用.当通过值传递引用类型的参数时,有可能更改引用所指向的数据,如某类成员的值(更改属性的值),但是无法更改引用本身的值:也就是说,不能使用相同的引 ...
- java 生成8位数字作为UID
java 生成8位数字作为UUID: /*** * 生成uid 8位数字 */public static String generateUID(){ Random random = new Rando ...
- ajax+php处理案例
<div> <table> <tr> <th>状态</th> <th>信息</th> </tr> < ...
- Mac OS X使用快捷键改善窗口管理的六个方法
http://www.macx.cn/thread-2085916-1-1.html 窗口全屏 ctrl+command+f
- MySQL管理_数据库启动与关闭
MySQL数据库服务器通常指的的是mysqld,而命令行mysql则是mysql客户端程序,这两个概念通常容易混淆.通常启动mysql服务器即是启动mysqld进程,mysqld启动后,可以通过mys ...
- SQL总结(二)连表查询
---恢复内容开始--- SQL总结(二)连表查询 连接查询包括合并.内连接.外连接和交叉连接,如果涉及多表查询,了解这些连接的特点很重要. 只有真正了解它们之间的区别,才能正确使用. 1.Union ...
- xml中数据存储 <![CDATA[ … ]]>
在xml中 有些可能是 转义的字符 比如像<等 &符号, 你没发现 在加参数后面要进行转义 写成: 可以是& 但是每处都要 这么写. 在未来不可控的 ...
- GC之六--SystemGC完全解读
概述 JVM的GC一般情况下是JVM本身根据一定的条件触发的,不过我们还是可以做一些人为的触发,比如通过jvmti做强制GC,通过System.gc触发,还可以通过jmap来触发等,针对每个场景其实我 ...
- VG vs SS WE vs IM [20160815]
上单:慎,纳尔,艾克,艾瑞莉娅,普朗克 中单:弗拉基米尔,玛尔扎哈,卡尔玛,丽桑卓,索尔,崔斯特,辛德拉 打野:雷克赛,奈德丽,古拉加斯,伊莉丝,赫卡里姆,玛尔扎哈 下路:艾希,克格莫,烬,希维尔,布 ...
- NGUI之UIRoot
原文:http://www.tasharen.com/forum/index.php?topic=6710.0 概述 UIRoot总是放在NGUI UI层级的最上层. 它用来使UI的缩放变得更容易.w ...