nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for propert
来源:互联网 发布:淘宝js跳转楼层 编辑:程序博客网 时间:2024/05/21 15:37
错误异常:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.String'
<select id="getNarCode" parameterType="java.lang.String" resultType="narCode"> select <include refid="Base_Column_List"></include> from nar_code <where> <if test="id != null"> id=#{id,jdbcType=VARCHAR} </if> </where> </select>
这是Mybatis Xml映射文件配置,当我执行这个映射select语句时报错:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.String'
解决办法有两种:
1.去掉sql语句的if标签限制
<if test="id != null"> id=#{id,jdbcType=VARCHAR}</if>
改为:
id=#{id,jdbcType=VARCHAR}
原因:我自己猜测加上if标签时,id属性没有包含在数据类型为String id对象中。
如果去掉if标签时直接使用这个数据类型为String id对象
2.将parameterType="java.lang.String"参数改为传一个自定义实体对象或者HashMap来封装这个id参数
原因:可以在自定义实体对象或者HashMap中找到这个id属性
阅读全文
0 0
- nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for propert
- nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for propert
- org.apache.ibatis.reflection.ReflectionException: There is no getter for propert
- mybatis映射异常:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'xxx' in
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'userIds' in
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'cla
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'agoTime' in
- Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'sex'
- Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'user
- 报错:org.apache.ibatis.reflection.ReflectionException: There is no getter for property named
- mybatis 异常信息 org.apache.ibatis.reflection.ReflectionException: There is no getter for property named
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'xx'的问题
- org.apache.ibatis.reflection.ReflectionException:There is no getter for property named 'parentId' in
- Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'empi
- 倒叙打印文件第二行的前100个大写字母
- 清华大学2001年机试-字符串排序-1066
- 深入理解java虚拟机(1)-----Java内存模型与内存溢出异常
- 二级java程序设计--文件
- 字符设备驱动框架3:深入探讨—完整的驱动代码工程
- nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for propert
- 与csdn的缘分
- HDOJ4417 Super Mario [主席树 + 二分]
- 深度学习开篇简介-人工智能
- 算法:非递归遍历二叉树
- Vocaloid
- android studio添加代码(方法)注释功能
- Unity中物体如何移动到鼠标点击位置
- Java集合归纳-<三>Map