easy-es icon indicating copy to clipboard operation
easy-es copied to clipboard

Lambda 缓存

Open Suomm opened this issue 3 years ago • 0 comments

LambdaWrapper 构建条件的时候,Lambda 表达式对应的字段名称缓存。

@Test
public void testSelect() {
    // 测试查询
    String title = "老汉";
    LambdaEsQueryWrapper<Document> wrapper = new LambdaEsQueryWrapper<>();
    wrapper.eq(Document::getTitle,title);
    Document document = documentMapper.selectOne(wrapper);
    System.out.println(document);
    Assert.assertEquals(title,document.getTitle());
}

e.g. Document::getTitle -> title 第二次使用的时候,直接使用第一次生成好的缓存。

Suomm avatar Dec 09 '22 06:12 Suomm