mybatis There is no getter for property named 'xx' in 'class java.lang.String
2016-06-08 15:45
417 查看
错误配置:
mybatis的xml
dao
修改方法一(推荐)
xml不改,dao加上param注解
修改方法二
dao不改,xml的参数用“_parameter”来代替
mybatis的xml
<select id="getDoctorList" resultMap="BaseResultMap" parameterType="java.lang.String"> select <include refid="Base_Column_List" /> from doctor where 1=1 <if test="name != null" > and name = #{name} </if> order by id </select>
dao
List<Doctor> getDoctorList(String name);
修改方法一(推荐)
xml不改,dao加上param注解
List<Doctor> getDoctorList(@Param(value="name")String name);
修改方法二
dao不改,xml的参数用“_parameter”来代替
<select id="getDoctorList" resultMap="BaseResultMap" parameterType="java.lang.String"> select <include refid="Base_Column_List" /> from doctor where 1=1 <if test="_parameter != null" > and name = #{_parameter} </if> order by id </select>
相关文章推荐
- SSM三大框架整合详细教程(Spring+SpringMVC+MyBatis)
- java处理日期时间的方法
- 基础SSH注解方式配置(ST2.1,SP3.1H4.14,JAVAEE6.0 JAVASE1.7)
- javassist3.17.0-GA, 3.17.1-GA.jar包bug,java.lang.VerifyError: Inconsistent args count operand in invo
- 两个与spring事务相关的问题
- 在MyEclipse10中进行Srping MVC环境的搭建
- SpringMVC学习笔记
- cn.springmvc.service.impl.AFDCityServiceImpl cannot be cast to cn.springmvc.service.AFDCityService
- Spring 攻略第003讲
- 用javaDBF操作(读、写)DBF文件
- SpringMVC @RequestBody接收Json对象字符串
- Spring基础五之Springmvc和hibernate事务不提交
- 在spring中date类型转换成string类型
- 解决eclipse中maven web工程打包成war(发布到tomcar)时lib中没有jar包的解决方法
- 解决eclipse Maven 主项目不能刷新maven
- Java基本数据类型和长度
- eclipse 启动是吧 jvm.dll failed
- Java读写局域网共享文件夹,Java读写Windows共享文件夹,JCIFS
- Android Studio使用SVN,与eclipse共同开发。
- java 补零