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