我用了这种List<Long> userIds = new LambdaQueryChainWrapper<>(sysUserRoleMapper) .select(SysUserRole::getUserId) .in(SysUserRole::getRoleId, groups) .list() .stream() .map(SysUserRole::getUserId) .collect(Collectors.toList());写法报错Caused by: org.flowable.common.engine.impl.javax.el.ELException: com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: can not find lambda cache for this property [userId] of entity [com.ehl.base.workflow.handler.SysUserRole]
时间: 2024-02-27 12:57:27 浏览: 19
这个错误信息显示是找不到 `SysUserRole` 实体类的 lambda cache,可能是因为 `SysUserRole` 类没有使用 `@TableName` 注解,或者没有在 MyBatis Plus 的配置文件中开启自动注入。
你可以尝试在 `SysUserRole` 类上添加 `@TableName` 注解,指定对应的表名,例如:
```
@TableName("sys_user_role")
public class SysUserRole {
// ...
}
```
然后在 MyBatis Plus 的配置文件中开启自动注入,例如:
```
@Configuration
@MapperScan("com.example.mapper")
public class MybatisPlusConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
@Bean
public ConfigurationCustomizer configurationCustomizer() {
return configuration -> configuration.setUseDeprecatedExecutor(false);
}
}
```
如果还有问题,请提供详细的错误信息和相关代码,我会尽力帮助你解决。