当前使用版本(必须填写清楚,否则不予处理)
3.3.0
该问题是怎么引起的?(最新版上已修复的会直接close掉)
重现步骤
举例如下 调用BaseMapper中updateById语句,更新SaleOrder实体
abstract class BaseEntity { Long id; public Long getId(){}; }
class SaleOrder extends BaseEntity{ String name; public String getName(){} }
SaleOrder order = new SaleOrder(): order.setName("mybatis");
update(order,Wrappers.
报错信息
can not find lambda cache for this property [id] of entity
Comment From: zacat
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 [id] of entity [com.zoe.framework.commons.entity.bus.BusEntity]]
Comment From: zacat
Mybatis plus 3.1.0 获取的类的方法在Mybatis plus 3.3.0 是正确的
Mybatis plus 3.2.0 以后获取的值就不对了。
Comment From: miemieYaho
有复现demo?
Comment From: zacat
取类名错误。导致的问题。
Comment From: miemieYaho
demo呢?
Comment From: zacat
稍等一下,我给你写一个。
Comment From: zacat
示例代码已发送jobob@qq.com邮箱请查收。
调用如下http://127.0.0.1:8089/wholesaleOrder?id=1217340327998074881
Comment From: miemieYaho
https://github.com/baomidou/mybatis-plus/issues/2086
Comment From: qmdx
问题点 @miemieYaho 泛型里面获取属性
public class BusSecApiController<
T extends BusSecEntity<SecEntity>,
Srv extends BusSecService<T, SecEntity>,
SecEntity extends BusDetailEntity,
SecSrv extends CrudService<SecEntity>> {
@Autowired
SecSrv secSrv;
@Autowired
Srv srv;
@GetMapping
public T get(String id) {
LambdaQueryWrapper<SecEntity> lw = Wrappers
.<SecEntity>lambdaQuery()
.eq(SecEntity::getInterId, id);