mybatis-plus报空指针异常
时间: 2023-09-23 20:12:34 浏览: 348
mybatis-plus报空指针异常可能是因为在普通类调用Mapper接口时,使用了mybatis-plus的功能,但在泛型类中找不到id属性,导致查找到的值为空。这会引发空指针异常(NullPointerException)。为了解决这个问题,可以通过深入学习MyBatis并了解其核心对象、配置文件和映射文件的使用来修复。确保在泛型类中定义了正确的id属性,并正确配置映射文件中的语句映射。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [SpringBoot:在普通类调用 Mapper 接口使用 MybatisPlus 报错:空指针异常(NullPointerException)](https://blog.csdn.net/weixin_43642521/article/details/124491271)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [MyBatis-plus使用出现空指针异常或者表不纯在](https://blog.csdn.net/gtq1061414470/article/details/121019792)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [SSM框架的学习与应用JavaEE(第二天)Mybatis的深入学习](https://download.csdn.net/download/m0_53659738/88241458)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文