FAQ(15):A query was run and no Result Maps were found for the Mapped Statement 'com.smbms.dao.UserMa
来源:互联网 发布:电脑桌面淘宝下载 编辑:程序博客网 时间:2024/05/23 20:45
发生错误--因为返回值没给填上去。
看Log:
org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.smbms.dao.UserMapper.USBI'. It's likely that neither a Result Type nor a Result Map was specified.### The error may exist in com/smbms/dao/UserMapper.xml### The error may involve com.smbms.dao.UserMapper.USBI### The error occurred while handling results### SQL: select * from smbms_user where id=?### Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.smbms.dao.UserMapper.USBI'. It's likely that neither a Result Type nor a Result Map was specified.at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)at com.sun.proxy.$Proxy4.USBI(Unknown Source)at com.smbms.entities.UserTest.test10(UserTest.java:255)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)at org.junit.runners.ParentRunner.run(ParentRunner.java:363)at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)Caused by: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.smbms.dao.UserMapper.USBI'. It's likely that neither a Result Type nor a Result Map was specified.at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.validateResultMapsCount(DefaultResultSetHandler.java:274)at org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleResultSets(DefaultResultSetHandler.java:180)at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)... 29 more
解决:
<select > 标签必须要有返回值!!
原:
<select id="USBI" >select * from smbms_user where id=#{id} </select>
改:
<select id="USBI" resultType="com.smbms.entities.User">select * from smbms_user where id=#{id} </select>
阅读全文
0 0
- FAQ(15):A query was run and no Result Maps were found for the Mapped Statement 'com.smbms.dao.UserMa
- A query was run and no Result Maps were found for the Mapped Statement
- A query was run and no Result Maps were found for the Mapped Statement
- A query was run and no Result Maps were found for the Mapped Statement
- A query was run and no Result Maps were found for the Mapped Statement
- A query was run and no Result Maps were found for the Mapped Statement 'com.atguigu.atcrowdfunding.p
- mybatis报错:A query was run and no Result Maps were found for the Mapped Statement
- mybatis报错:A query was run and no Result Maps were found for the Mapped Statement
- 使用Mybatis时出错:A query was run and no Result Maps were found for the Mapped Statement
- Mybatis报错—— A query was run and no Result Maps were found for the Mapped Statement
- A query was run and no Result Maps were found
- A query was run and no Result Maps were found
- org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the
- FAQ(10):Type interface com.smbms.dao.UserMapper is not known to the MapperRegistry.
- FAQ(14):Could not find result map com.smbms.entities.User
- No default view was found for object type 10201 and query type 2
- FAQ(9):org.apache.ibatis.binding.BindingException: Type interface com.smbms.dao.UserMapper is not kn
- No unnamed transitions were found for the task'' ?????
- 如何处理SQLServer数据库损坏
- Struts2中的ActionContext详解
- ELK相关文章索引(2)
- tensorflow安装
- vue 新建项目在IE9 10 打不开
- FAQ(15):A query was run and no Result Maps were found for the Mapped Statement 'com.smbms.dao.UserMa
- C相关练习题
- HDOJ 2004 成绩转换
- java注释及自动生成文档
- Canny边缘检测部分步骤思考
- DFS专练4 素数环问题
- 基于混淆矩阵的评估度量,代码实践,f1,auc
- 测试cpu的简单工具-dhrystone
- Sublime text 3 搭建Python3开发环境