com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: can not find lambda cache for this property [xxx] of entity [com.xxx.si.fss.ssf.ass.entity.xxx]
因为MP3.2+之后不会缓存实体类的父类字段信息,所以在使用泛型的Lambda表达式时会报错.
{@code MybatisPlusException: can not find lambda cache for this entity [com.copm.ifm.base.basic.pojo.BaseTreePO]}
原因是在执行{@link com.baomidou.mybatisplus.core.toolkit.LambdaUtils#getColumnMap(Class)}时
他会将所有扫描到的mapper中的泛型({@link BaseMapper<Class>}中的Class,即实体类)的字段信息缓存到
{@link com.baomidou.mybatisplus.core.toolkit.LambdaUtils}中的{@code COLUMN_CACHE_MAP}中。
但是MP3.2+之后不会加载父类的信息,所以{@code COLUMN_CACHE_MAP}中没有相关缓存,就报错了。
因此我们单独为{@link BaseTreePO}添加一个的Mapper类,这样他就会缓存该类的信息了。
错误信息如下:
com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: can not find lambda cache for this property [aricOrderNo] of entity [com.pcitc.si.fss.ssf.ass.entity.SsfAssRule]
总结:不适用 lambda查询了,改用别的。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!