Could not find parameter map com.itcast.mapper.userinfMapper.map

问题?org.apache.ibatis.exceptions.PersistenceException:

### Error querying database.  Cause: org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.itcast.mapper.userinfMapper.map

### Cause: org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.itcast.mapper.userinfMapper.map

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)

at com.itcast.test.UserBookTest.bookTest(UserBookTest.java:19)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Caused by: org.apache.ibatis.builder.IncompleteElementException: Could not find parameter map com.itcast.mapper.userinfMapper.map

at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:338)

at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:302)

at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:109)

at org.apache.ibatis.session.Configuration.buildAllStatements(Configuration.java:682)

at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:613)

at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:608)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:103)

... 25 more

Caused by: java.lang.IllegalArgumentException: Parameter Maps collection does not contain value for com.itcast.mapper.userinfMapper.map

at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:775)

at org.apache.ibatis.session.Configuration.getParameterMap(Configuration.java:554)

at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementParameterMap(MapperBuilderAssistant.java:336)

... 31 more

最近在做MyBatis的时候,这个问题,找了好久了。

原来原因是:在映射文件中的select语句属性中,我写成parameterMap="map",应该写成parameterType="map"就可以了

时间: 2024-10-25 18:57:11

Could not find parameter map com.itcast.mapper.userinfMapper.map的相关文章

java基础-Map的静态初始化以及Map的遍历等.....................

1.map的静态初始化,以及map遍历的几种方法: package com.cy.test; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; public class Test { public static void main(String[] args) { Map<String, Integer> map = new HashMap

java如何对map进行排序详解(map集合的使用)

今天做统计时需要对X轴的地区按照地区代码(areaCode)进行排序,由于在构建XMLData使用的map来进行数据统计的,所以在统计过程中就需要对map进行排序. 一.简单介绍Map 在讲解Map排序之前,我们先来稍微了解下map.map是键值对的集合接口,它的实现类主要包括:HashMap,TreeMap,Hashtable以及LinkedHashMap等.其中这四者的区别如下(简单介绍): HashMap:我们最常用的Map,它根据key的HashCode 值来存储数据,根据key可以直接

实现jsp页面两级列表的显示(Map 传值到Jsp 页面;Map去key 和 value 的方法; 实例记载,备不时之需。

Action: List.vm 页面效果: 实现jsp页面两级列表的显示(Map 传值到Jsp 页面;Map去key 和 value 的方法: 实例记载,备不时之需.

map泛型 map不指定泛型 与 Map&lt;Object,Object&gt;的区别

map泛型 map不指定泛型 与 Map<Object,Object>的区别 private void viewDetail(){ Map map1 = new HashMap(); Map<String,Object> map2 = new HashMap<String,Object>(); Map<Object,Object> map3 = new HashMap<Object,Object>(); Map<String,String&

封装的函数ClearAllData() 清空地图文档并新建mainMapControl中Map以及新建EagleEyeMapControl中Map

private void ClearAllData() { if (mainMapControl.Map != null && mainMapControl.Map.LayerCount > 0) { //新建mainMapControl中Map IMap dataMap = new MapClass(); dataMap.Name = "Map"; mainMapControl.DocumentFilename = string.Empty;//Document

把List&lt;Map&lt;String,Object&gt;&gt;转成Map&lt;String,Object&gt;

Map<String, Object> parmMap = new HashMap<String, Object>(); //定义一个用于存储强转后的Map List<Map<String, Object>> findActivityList = groupConfigDao.findActivityList(); //查询List<Map>里的数据 //List<Map<String, Object>> (findAct

c++map按value排序--将map的pair对保存到vector中,然后写比较仿函数+sort完成排序过程。

map是用来存放<key, value>键值对的数据结构,可以很方便快速的根据key查到相应的value.假如存储学生和其成绩(假定不存在重名,当然可以对重名加以区分),我们用map来进行存储就是个不错的选择. 我们这样定义,map<string, int>,其中学生姓名用string类型,作为Key:该学生的成绩用int类型,作为value.这样一来,我们可以根据学生姓名快速的查找到他的成绩. 但是,我们除了希望能够查询某个学生的成绩,或许还想看看整体的情况.我们想把所有同学和他

分页查询和分页缓存查询,List&lt;Map&lt;String, Object&gt;&gt;遍历和Map遍历

分页查询 String sql = "返回所有符合条件记录的待分页SQL语句"; int start = (page - 1) * limit + 1; int end = page * limit; sql = "select * from (select fulltable.*, ROWNUM RN from (" + sql + ") fulltable where ROWNUM <= " + end + ") where

map&lt;虽然一直不喜欢map&gt;但突然觉得挺好用的

#include<iostream> #include<cmath> #include<cstdio> #include<algorithm> #include<cstring> #include<string> #include<stack> #include<queue> #include<map> #include<cstdlib> #include<set> #inc