Home > Back-end >  <select id="selectUser resultType"=> "map" to me is like that, why still a
<select id="selectUser resultType"=> "map" to me is like that, why still a

Time:09-20

Org. Apache. Ibatis. Exceptions. PersistenceException:
# # # Error querying the database. Cause: org. Apache. Ibatis. Builder. IncompleteElementException: Could not find the result map. Org. Fkit mapper. UserMapper.
# # # Cause: org. Apache. Ibatis. Builder. IncompleteElementException: Could not find the result map. Org. Fkit mapper. UserMapper.
The at org. Apache. Ibatis. Exceptions. ExceptionFactory. WrapException (30) ExceptionFactory. Java:
The at org. Apache. Ibatis. Session. Defaults. DefaultSqlSession. SelectList (DefaultSqlSession. Java: 150)
The at org. Apache. Ibatis. Session. Defaults. DefaultSqlSession. SelectList (DefaultSqlSession. Java: 141)
The at org. Apache. Ibatis. Session. Defaults. DefaultSqlSession. SelectList (DefaultSqlSession. Java: 136)
The at org. Fkit. Test. SelectStudentTest. Main (SelectStudentTest. Java: 18)
Under Caused by: org. Apache. Ibatis. Builder. IncompleteElementException: Could not find the result map. Org. Fkit mapper. UserMapper.
The at org. Apache. Ibatis. Builder. MapperBuilderAssistant. GetStatementResultMaps (MapperBuilderAssistant. Java: 346)
The at org. Apache. Ibatis. Builder. MapperBuilderAssistant. AddMappedStatement (MapperBuilderAssistant. Java: 290)
The at org. Apache. Ibatis. Builder. XML. XMLStatementBuilder. ParseStatementNode (XMLStatementBuilder. Java: 109)
At org. Apache. Ibatis. Session. The Configuration. BuildAllStatements (788) Configuration. Java:
At org. Apache. Ibatis. Session. The Configuration. GetMappedStatement (719) Configuration. Java:
At org. Apache. Ibatis. Session. The Configuration. GetMappedStatement (714) Configuration. Java:
The at org. Apache. Ibatis. Session. Defaults. DefaultSqlSession. SelectList (DefaultSqlSession. Java: 147)
. 3 more
Under Caused by: Java. Lang. IllegalArgumentException: Result Maps collection does not contain the value for org. Fkit. Mapper. UserMapper.
The at org. Apache. Ibatis. Session. The Configuration $StrictMap. Get (888) Configuration. Java:
At org. Apache. Ibatis. Session. The Configuration. GetResultMap (640) Configuration. Java:
The at org. Apache. Ibatis. Builder. MapperBuilderAssistant. GetStatementResultMaps (MapperBuilderAssistant. Java: 344)
. Nine more

CodePudding user response:

ResultType should write the corresponding full path names such as: com. Test. Dao. The User

CodePudding user response:

Try to BaseResultMap

CodePudding user response:

ResultMap to configure the corresponding entity class full name of the class rather than the full name of the class Mapper

CodePudding user response:

But I is a set of return is the List, not a class, write the full path is also one of the error

CodePudding user response:

You are to return to a List The data? Change the map to the map package path
The map - & gt; Java. Util. The Map

CodePudding user response:

In the MAO package path is an error,

CodePudding user response:

# # # Cause: org. Apache. Ibatis. Builder. IncompleteElementException: Could not find the result map. Org. Fkit mapper. UserMapper.

I estimate is written resultMap="org. Fkit. Mapper. UserMapper", should use the resultType="org. Fkit. Mapper. UserMapper"

You still put your code up to look at it

CodePudding user response:

<? The XML version="1.0" encoding="utf-8"?>
"Http://mybatis.org/dtd/mybatis-3-mapper.dtd" & gt;

ResultType="map" said returns a map object
Do the key using the column name, value is the value - & gt;









& lt; ! - according to the class id of the class - & gt;
SELECT * FROM tb_student






  • Related