nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for propert
2017-08-26 10:13
676 查看
错误异常:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.String'
这是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标签限制
<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属性
相关文章推荐
- 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
- org.apache.ibatis.reflection.ReflectionException:There is no getter for property named 'parentId' 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 'agoTime' in
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'telOrName'
- 报错:org.apache.ibatis.reflection.ReflectionException: There is no getter for property named
- Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'empi
- 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 'xxx' 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 named 'funcSetId' in 'class java.lang.Integer'
- 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 'xx'的问题
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘__frch_item
- Spring+Mybatis 查询所有数据时发生异常:org.apache.ibatis.reflection.ReflectionException: There is no getter for
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'cla
- 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 'userIds' in