原文:BUG03- 【MP的批量操作不能插入空集合】com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: error: entityList must not be empty

error: entityList must not be empty com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: error: entityList must not be empty at com.baomidou.mybatisplus.core.toolkit.ExceptionUtils.mpe Exce ...

2020-01-15 18:01 0 3600 推荐指数:

查看详情

entityList must not be empty

这个错误是在使用Mybatis-Plus的批量操作的时候报出的错误。 意思是批量插入集合不能为空。 解决办法:可以在插入之前对集合进行非空判断,不为空时再进行批量插入操作。(集合长度也要进行判断) ...

Mon Jun 29 19:11:00 CST 2020 0 3191
java返回集合为null还是空集合以及空集合的三种写法

个人认为在自己写接口时,需要返回集合时返回一个空集合,比如mybatis查询如果返回一个集合,结果为空时也会返回一个空集合而不是null。 那么这样有什么好处呢?最大的好处就是调用方不用在判断是否为null,可以直接用,因为不用抛空 ...

Thu Jul 15 22:53:00 CST 2021 0 173
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM