遇到一个奇怪的问题,使用Spring Boot和MyBatis-Plus。
在使用QueryWrapper查询语句时报错:“Cannot invoke “Object.hashCode()” because “key” is null”

我们使用的是MyBatis-Plus的3.3.2版本和JDK 19

据说,这个问题出现在JDK 17与MyBatis-Plus 3.3.x时会出现。

解决办法:
将MyBatis-Plus升级到3.5.1版本后,问题得到了解决。