当前使用版本(必须填写清楚,否则不予处理)

3.1.2

该问题是怎么引起的?(最新版上已修复的会直接close掉)

BaseEntity中有parentIds等属性;ChildEntity继承BaseEntity;在BaseService, T extends BaseEntity\> extends ServiceImpl中使用 QueryWrapper qw = new QueryWrapper<>(); qw.lambda().like(T::getParentIds,entity.getId()); baseMapper.selectList(qw); 查询时抛出can not find lambda cache for this property [parentIds] of entity [BaseEntity]的异常

调试发现AbstractLambdaWrapper的getColumn方法中56行得到的aClass是父类BaseEntity

重现步骤

报错信息

2019-07-29 15:57:57.786 [http-nio-8080-exec-1] ERROR o.jeecg.common.exception.JeecgBootExceptionHandler:53 - nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'ew.sqlSegment != null and ew.sqlSegment != '' and ew.nonEmptyOfWhere'. Cause: org.apache.ibatis.ognl.OgnlException: sqlSegment [com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: can not find lambda cache for this property [parentIds] of entity [org.jeecg.modules.pmis.common.BaseEntity]] org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'ew.sqlSegment != null and ew.sqlSegment != '' and ew.nonEmptyOfWhere'. Cause: org.apache.ibatis.ognl.OgnlException: sqlSegment [com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: can not find lambda cache for this property [parentIds] of entity [org.jeecg.modules.pmis.common.BaseEntity]] at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at com.sun.proxy.$Proxy135.selectList(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:62) at com.sun.proxy.$Proxy199.selectList(Unknown Source)

Comment From: miemieYaho

那就不支持你这么玩

Comment From: kanghouchao

3.1.0可以这么操作

Comment From: JoeyBling

@zfj0952 可以参考我的解决方案 https://github.com/baomidou/mybatis-plus/issues/2616