The result of mybatis query is actually List list = {null}
will enter the loop traversal code, in the loop inside T = null will be a null pointer exception
Solution:
1. Remove the empty object element from list: list.removeAll(Collections.singleton(null));
2. Add ifnull (.... ,0)
.to the select field in the SQL statement.
Read More:
- Mybatis Error: All elements are null [How to Solve]
- Not showing null elements JAVA [How to Solve]
- [Solved] mybatis plus Insert Error: mybatis plus Error setting null for parameter #1 with JdbcType OTHER
- JUnit tests mybatis-plus error: null pointer [How to Solve]
- [Solved] Mybatis.generator error: Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.2
- [Solved] Mybatis Error: Could not find resource mybatis-conf.xml
- [Solved] Tk-Mybatis Error: tk.mybatis.mapper.MapperException:
- Mapper.xml Error: Error setting non null for parameter #3 with JdbcType null.
- [Solved] Mybatis insert Error: Cause: java.sql.SQLException: SQL String cannot be empty
- [Solved] Mybatis integrates PageHelper and uses sqlserver paging error
- Mybatis sets the primary key Auto-Increment error: No setter found for the keyProperty
- How to Solve SQL comments error in the mybatis query
- mybatis “case when” Error: Failed to process, please exclude the tableName or statementId.
- Mybatis single parameter pass in exception (How to Fix)
- [Solved] Mybatis-Plus Error: Invalid bound statement (not found)
- mybatis-plus Common Error and Their Solution
- Ruoyi-cloud Integrated mybatis-plus Error: Unknown column ‘search_value‘ in ‘field list‘
- How to Solve mybatis-plus Paging Plug-in PaginationInnerInterceptor error
- Ecilpse: All Common Shortcut keys
- [Solved] Mybatis Error: attempting to get column ‘XX’ from result set