easy-es
easy-es copied to clipboard
Lambda 缓存
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 第二次使用的时候,直接使用第一次生成好的缓存。