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的 ...
随机推荐
- JavaScript 字符串转日期
一.将字符串装换为日期 var date= new Date(Date.parse(strTime.replace(/-/g, "/"))); //转换成Data();
- There is already an open DataReader associated with this Command which must be closed first." exception in Entity Framework
Fixing the "There is already an open DataReader associated with this Command which must be clos ...
- 030. asp.net中DataList数据绑定跳转(两种方式)的完整示例
前台代码: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.as ...
- 使用Python玩转WMI
最近在网上搜索Python和WMI相关资料时,发现大部分文章都千篇一律,并且基本上只说了很基础的使用,并未深入说明如何使用WMI.本文打算更进一步,让我们使用Python玩转WMI. 1 什么是WMI ...
- GridView使用自带分页功能时分页方式及样式PagerStyle
// 转向地址:http://www.bubuko.com/infodetail-412562.html GridView分页,使用自带分页功能,类似下面样式: 在aspx页面中,GridView上的 ...
- SpringMVC学习系列(10) 之 异常处理
在项目中如何处理出现的异常,在每个可能出现异常的地方都写代码捕捉异常?这显然是不合理的,当项目越来越大是也是不可维护的.那么如何保证我们处理异常的代码精简且便于维护呢?这就是本篇要讲的内容—>异 ...
- log4net:保存日志到数据库
1:下载log4net http://logging.apache.org/log4net/download_log4net.cgi 2:引用到项目 下载以后,在项目中引用log4net.dll 3: ...
- Angular SEO方案
1.如果是java web项目,可以直接使用AngularSEO Filter. 官网地址 :http://www.angularseo.net/#about <filter> <f ...
- div 居中
Found another solution: Just add position: relative; top: 50%; transform: translateY(-50%); to the i ...
- 面向对于javascript编程
以构造函数的方式定义对象 function Person(name, age) { this.name = name; this.age = age; this.sayName = function ...