There is no getter for property named 'id' in class 'java.lang.String'
https://blog.csdn.net/u011897392/article/details/46738747
使用mybatis传入参数,如果在mappin.xml中使用<if>标签判断该参数是否为空,通常会报以上异常,解决方法:在接口中该方法的参数前加上@Param("参数名")注解,即可
接口:
public interface UserMapper {
//根据名称查询用户
List<MAP> queryUserByName(@Param("name")String name);
}
mapping.xml:
<mapper namespace="com.mybatis.test.dao.UserMapper">
<select id="queryUserByName" parameterType="String" resultType="java.util.HashMap">
select
t_id as id,
t_name as name,
t_password as password
from mybatis_user
where 1=1
<if test="name != null">
and t_name=#{name}
</if>
order by t_id
</select>
</mapper>
There is no getter for property named 'id' in class 'java.lang.String'的更多相关文章
- Mybatis笔记四:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.String'
错误异常:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for pr ...
- 关于mybtis 使用过程中发生There is no getter for property named 'id' in class 'java.lang.String' 错误
今天在修改一个关于mybtis语句时,偶然发现的一个错误 There is no getter for property named 'id' in class 'java.lang.String' ...
- mybaits错误解决:There is no getter for property named 'id' in class 'java.lang.String'
在使用mybaitis传参数的时候,如果仅传入一个类型为String的参数,那么在 xml文件中应该使用_parameter 来代替参数名. 正确的写法: <span style="f ...
- Mybatis-There is no getter for property named 'id' in 'class java.lang.String'
<mapper namespace="cn.telchina.standard.mapper.SysOrgnMapper"> <!-- <![CDATA[s ...
- There is no getter for property named 'id' in 'class java.lang.Integer
There is no getter for property named 'id' in 'class java.lang.Integer 问题描述: 使用mybatis传入参数, 当参数类型是St ...
- 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 ...
- mybaits错误解决:There is no getter for property named 'parentId ' in class 'java.lang.String'
在使用mybaitis传参数的时候,如果仅传入一个类型为String的参数,那么在 xml文件中应该使用_parameter来代替参数名. 比如mapper中如下方法,只有一个String值 publ ...
- 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 ...
随机推荐
- HDU - 6063 RXD and math
Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6063 打表发现规律是n^k #include <iostream> #inc ...
- jsp问题记录
2014-10-10 20:53:16 Jsp的el表达式:‘${value}’ 用于获取后台传过来的值 而<%=value %>则是获取当前页面java代码的值
- AJPFX关于Java内部类及其实例化
public class Outer { private int size; public class Inner { private int counter = 10; ...
- 【学习笔记】一:JavaScript简介
1.JavaScript简史 1)JavaScript最初的功能只是用来在客户端做简单的输入验证器,减少客户端与服务器端的数据交互(毕竟那个年代网速有限). 2)JavaScript的飞速发展及Net ...
- Ant题解
Description: 一根长度为L厘米的木棒上有N只蚂蚁,每只蚂蚁要么向左走,要么向右走,速度为1厘米/秒.当两只蚂蚁相撞时,他们会同时掉头(掉头时间不计)给出每只蚂蚁距离木棒左端的距离,问多少秒 ...
- (转)Spring4.2.5+Hibernate4.3.11+Struts1.3.8集成方案二
http://blog.csdn.net/yerenyuan_pku/article/details/52894958 前面我们已经集成了Spring4.2.5+Hibernate4.3.11+Str ...
- [转] 学习,思维三部曲:WHAT、HOW、WHY(通过现象看本质)
https://www.douban.com/note/284947308/?type=like 学习技术的三部曲:WHAT HOW WHY 我把学习归类为三个步骤:What.How.Why.经过我对 ...
- DROP VIEW - 删除一个视图
SYNOPSIS DROP VIEW name [, ...] [ CASCADE | RESTRICT ] DESCRIPTION 描述 DROP VIEW 从数据库中删除一个现存的视图. 执行这条 ...
- upload 上传 加token 在 :headers='headers' 注意 不要直接写$refs.upload.headers = {} 这样vue会警告 修改组件内部变量
upload 上传 加token 在 :headers='headers' 注意 不要直接写$refs.upload.headers = {} 这样vue会警告 修改组件内部变量 <Upload ...
- 搜索 || DFS || POJ 1321 棋盘问题
棋盘上#可以放,.不可以放,每行每列只能放一个 *解法:类似八皇后问题 dfs+回溯,考虑每一行和每一列 [[[[dfs的样子]]]]最前面写达到目标状态or不能走下去了 然后return #incl ...