Home > Back-end >  Mybatis - plus execute SQL error
Mybatis - plus execute SQL error

Time:12-12



Above SQL database is normal, mybatis - plus in the program execution error, error information is as follows:

Org. Mybatis. Spring. MyBatisSystemException: nested exception is org. Apache. Ibatis. Exceptions. PersistenceException:
# # # Error querying the database. Cause: the baomidou. Mybatisplus. Core. Exceptions. MybatisPlusException: Failed to process, both please exclude the tableName or statementId.
Error: SQL select provinceid, province, the CONVERT (province USING GBK) as a
The from provinces
The order by a
# # # The error may exist in The file [E: \ CITC \ zxgd_back \ blade - service \ blade - user \ target \ classes \ org \ springblade \ system \ user \ mapper \ UserMapper XML]
# # # The error may involve org. Springblade. System. User. Mapper. UserMapper. GetProvince
# # # The error occurred while executing a query
# # # Cause: com. Baomidou. Mybatisplus. Core. Exceptions. MybatisPlusException: Failed to process, both please exclude the tableName or statementId.
Error: SQL select provinceid, province, the CONVERT (province USING GBK) as a
The from provinces
The order by a
The at org. Mybatis. Spring. MyBatisExceptionTranslator. TranslateExceptionIfPossible (MyBatisExceptionTranslator. Java: 77)
The at org. Mybatis. Spring. SqlSessionTemplate $SqlSessionInterceptor. Invoke (SqlSessionTemplate. Java: 446)
At com. Sun. Proxy. $Proxy168. SelectList (Unknown Source)
The at org. Mybatis. Spring. SqlSessionTemplate. SelectList (SqlSessionTemplate. Java: 230)
At com. Baomidou. Mybatisplus. Core. Override. MybatisMapperMethod. ExecuteForMany (MybatisMapperMethod. Java: 158)
At com. Baomidou. Mybatisplus. Core. Override. MybatisMapperMethod. Execute (MybatisMapperMethod. Java: 76)
At com. Baomidou. Mybatisplus. Core. Override. MybatisMapperProxy. Invoke (MybatisMapperProxy. Java: 62)
At com. Sun. Proxy. $Proxy169. GetProvince (Unknown Source)

CodePudding user response:

Want to see the database
 provinceid, province 
the name of the two fields, as well as mybatis - plus the return value will be based upon the getProvince UserMapper method to automatically determine the result type is an object or collection, need not specified in the resultType, to specify, you should specify the User entity fully qualified name of a class, or specify a custom result set in the XNL maps map

CodePudding user response:

The XNL is XML...

CodePudding user response:

reference 1/f, green orange response:
 
want to see a database provinceid, province
the name of the two fields, as well as mybatis - plus the return value will be based upon the getProvince UserMapper method to automatically determine the result type is an object or collection, need not specified in the resultType, to specify, you should specify the User entity fully qualified name of a class, or specify a custom result set in the XNL map map

You said that to also go, so can also be written to me, but now the problem is not caused by it

CodePudding user response:

I also encountered this problem, my friend you solved?

CodePudding user response:

Screening:
1. Before and after the SQL keyword whether gave space-delimited, whether more punctuation, etc.,
2. Streamline SQL, screening of SQL syntax is not supported by the program,
For example: select provinceid, province, the CONVERT (province USING GBK) as a
The from provinces
The order by a
First to select provinceid, province
The from provinces
Look problems
3. & lt; Select id="getProvince" resultType="Java. Util. Map" & gt; The id="getProvince," repeated id?

CodePudding user response:

Don't understand why use mybatis - plus write XML
  • Related