当前使用版本(必填,否则不予处理)
3.5.5
该问题是如何引起的?(确定最新版也有问题再提!!!)
写单元测试时,
重现步骤(如果有就写完整)
InjectMocks 对象方法中使用 LambdaUpdateWrapper#set()方法 or LambdaQueryWrapper #select 方法时 出现 com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: can not find lambda cache for this entity
报错信息
com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: can not find lambda cache for this entity 请问如何解决这个问题。 在不加载spring配置。
Comment From: jov1
可以试试
@Before
public void setUp() throws Exception {
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""),
entity对象.class);
}
Comment From: nieqiurong
提供测试用例代码上来看看
Comment From: haoyi01
OK,可以使用,完美解决,非常感谢
可以试试 @before public void setUp() 抛出异常 {
TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""), entity对象.class); }