Mapped Statements (result....)collection does not contain value for...(mybatis-spring)
2012-08-01 13:24
573 查看
1、
在进行SS+mybatis结合的时候 经常会遇到这样的错误(Mapped Statements collection does not contain value for...)
从字面上的意思很难理解和定位是哪里出错了, 经过不探索果然功夫不负有心人,其实是命名空间引入错了
正确的引入应该把类名给引入进来 如下:
这样它就会寻找com.mochasoft.proscenium.dao.AutocompleteDao类下面的getSearchHistoryByTerm方法
2、
还有一种跟这个类似的错误:Result Maps collection does not contain value for。。。
出现这个错误 主要是因为你的select标签内部的resultMap属性 指向的不正确
在进行SS+mybatis结合的时候 经常会遇到这样的错误(Mapped Statements collection does not contain value for...)
从字面上的意思很难理解和定位是哪里出错了, 经过不探索果然功夫不负有心人,其实是命名空间引入错了
正确的引入应该把类名给引入进来 如下:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.mochasoft.proscenium.dao.AutocompleteDao"> <resultMap type="searchHistory" id="searchHistoryMap"> <result column="word" property="word"/> <result column="search_count" property="seachCount"/> </resultMap> <select id="getSearchHistoryByTerm" resultMap="searchHistoryMap" parameterType="String"> select word, search_count from v_search_history where word like #{term} order by search_count </select> </mapper>
这样它就会寻找com.mochasoft.proscenium.dao.AutocompleteDao类下面的getSearchHistoryByTerm方法
2、
还有一种跟这个类似的错误:Result Maps collection does not contain value for。。。
出现这个错误 主要是因为你的select标签内部的resultMap属性 指向的不正确
相关文章推荐
- Mybatis 错误:Result Maps collection does not contain value for java.util.Map
- Mapped Statements collection does not contain value for com.mybatis_Spring.dao.getAllUsers
- MyBatis学习_1_ Result Maps collection does not contain value for *
- MyBatis出错Result Maps collection does not contain value for java.lang.Integer
- MyBatis出错Result Maps collection does not contain value for java.lang.Integer
- spring整合mybatis bug解决java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for ...
- 使用Maven构建项目,spring整合mybatis发生错误:Mapped Statements collection does not contain value for
- mybatis+springMVC整合出现Mapped Statements collection does not contain value for ***
- mybatis+spring MVC启动的时候 4000 出现Mapped Statements collection does not contain value for
- Spring整合MyBatis错误:Mapped Statements collection does not contain value for
- Mapped Statements collection does not contain value for com.yangyun.springmybatis.dao.UsersDao.addUs
- Result Maps collection does not contain value for.blog.dao.BlogDAO.int
- 解决mybatis,java.lang.IllegalArgumentException Mapped Statements collection does not contain value for
- MyBatis:Parameter Maps collection does not contain value for
- Result Maps collection does not contain value for java.util.Map
- Result Maps collection does not contain value for...
- Result Maps collection does not contain value for frontpreviewprofitManage.cdata
- mybatis错误 Mapped Statements collection does not contain value for
- mybatis 错误 Mapped Statements collection does not contain value for
- MyBatis异常java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for