【Mybatis】There is no getter for property named 'type' in 'class java.lang.String'
2016-02-22 11:00
579 查看
DAO:
List<String> getNameByType(String type);
原Mapper:
<select id="getNameByType" resultType="String" parameterType="String">
select name from t_people
where
<if test="type == null">
type is null
</if>
<if test="type != null">
type = #{type}
</if>
</select>
如果只传入一个 String 类型的参数,那么应该把 select 配置中所有用到 type 参数的地方都改成 _parameter
新Mapper:
<select id="getNameByType" resultType="String" parameterType="String">
select name from t_people
where
<if test="_parameter == null">
_parameter is null
</if>
<if test="_parameter != null">
type = #{_parameter}
</if>
</select>
End .
List<String> getNameByType(String type);
原Mapper:
<select id="getNameByType" resultType="String" parameterType="String">
select name from t_people
where
<if test="type == null">
type is null
</if>
<if test="type != null">
type = #{type}
</if>
</select>
如果只传入一个 String 类型的参数,那么应该把 select 配置中所有用到 type 参数的地方都改成 _parameter
新Mapper:
<select id="getNameByType" resultType="String" parameterType="String">
select name from t_people
where
<if test="_parameter == null">
_parameter is null
</if>
<if test="_parameter != null">
type = #{_parameter}
</if>
</select>
End .
相关文章推荐
- Android之获取手机上的图片和视频缩略图thumbnails
- android string.xml文件中的整型和string型代替
- Android java 与 javascript互访(相互调用)的方法例子
- android上改变listView的选中颜色
- String.intern
- Prototype源码浅析 String部分(二)
- Ruby中的String对象学习笔记
- PostgreSQL ERROR: invalid escape string 解决办法
- C#中Ilist与list的区别小结
- C#中IList<T>与List<T>的区别深入解析
- C#对list列表进行随机排序的方法
- 浅谈C++中的string 类型占几个字节
- 标准C++类string的Copy-On-Write技术
- Vc++ 控件List Control用法总结
- C++实现的泛型List类分享
- C++实现string存取二进制数据的方法
- C#中string和StingBuilder内存中的区别实例分析
- PHP STRING 陷阱原理说明
- c#中 String和string的区别介绍
- C#实现的图片、string相互转换类分享