• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Loneliness Ends HUHU
热情坦诚
博客园    首页    新随笔    联系   管理    订阅  订阅
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'list' in 'c
 org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'list' in 'class com.bw.yun.pojo.Page'

报了这个错。今天一直都在该这个方法以及优化


我的是目的是:在我的dao中根据一个对象字段进行查询,返回一个 list<对象> ,我的实体类是这样的


然后我的sql语句是这样的


主要说一下这个collection是你实体类的字段名,item 是你给该字段起的别名 ,其他的大家应知道吧。

然后我的错误是把collection 写为list 其实是错误的。应该是实体类的字段名。

注意:

    Mapper.xml

<select id="getFileStrByDts" resultType="FileStr">
		select * from
		fileStr
		where dt in
		<foreach collection="dts" index="index" item="dt" open="("
			separator="," close=")">
			#{dt}
		</foreach>
		limit #{start_index},#{page_rows}
	</select>

接口中:

	/**
	 * 根据路径返回文件
	 * 
	 * @param dt
	 * @return
	 */
	public List<FileStr> getFileStrByDts(Page page);

就是这个样子的

posted on 2018-06-14 00:56  meiLinYa  阅读(232)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3