A query is run and no Result Maps were found for ... The original is the Mapper.xml file is a problem, is the use of MyBatis most common error

Source: Internet
Author: User

Today, there is a problem, the original Mapper.xml file is a problem, is the use of MyBatis most common error

The result of the error is this:

A query is run and no Result Maps were found for the Mapped Statement ' cn.zrgk.dao.RoleMapper.getRoleList '.  

It's likely that neither a result Type nor a result Map is specified.
Org.apache.ibatis.executor.ExecutorException:A Query is run and no Result Maps were found  for the Mapped Statement ' cn.zrgk.dao.RoleMapper.getRoleList '. 
It's likely that neither a result Type nor a result Map is specified.Org.apache.ibatis.executor.resultset.FastResultSetHandler.validateResultMapsCount (Fastresultsethandler.java : 177) org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets (Fastresultsethandler.java: 150) org.apache.ibatis.executor.statement.PreparedStatementHandler.query (Preparedstatementhandler.java:57) org.apache.ibatis.executor.statement.RoutingStatementHandler.query (Routingstatementhandler.java:70) org.apache.ibatis.executor.SimpleExecutor.doQuery (Simpleexecutor.java:57) org.apache.ibatis.executor.BaseExecutor.queryFromDatabase (Baseexecutor.java:259) org.apache.ibatis.executor.BaseExecutor.query (Baseexecutor.java:132) org.apache.ibatis.executor.CachingExecutor.query (Cachingexecutor.java:105) org.apache.ibatis.executor.CachingExecutor.query (Cachingexecutor.java:81) sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) Sun.reflect.NativeMethodAccessorImpl.invoke ( Nativemethodaccessorimpl.java:57) Sun.reflect.DelegatingMethodAccessorImpl.invoke (Delegatingmethodaccessorimpl.java:43) Java.lang.reflect.Method.invoke (Method.java:606)

One of the query statements in my Mapper.xml file is written like this:

Look at figure one, it seems there is no mistake at all, right? Look again.

Yes, yes, I did not specify the return type of this method, the system is not recognized, so changed a bit, found no error

So in peacetime, we need to pay more attention to these details, but also to understand

A query is run and no Result Maps were found for ... The original is the Mapper.xml file is a problem, is the use of MyBatis most common error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.