Easy-Es Easy-Es
💋Home
  • v2.0.0(current version)
  • What's New

    • What' s New In Easy-Es v2.0.0?
  • history version

    • v1.x.x
  • Upgrade guide

    • Upgrade to 2.x.x instructions
💖Support
  • OS Community
  • Recommend Goods
  • Project PPT (opens new window)
  • Project introduction
  • Project members
  • PR
Join
Customer
  • Doc-Apis (opens new window)
  • Fitness plan automatic generation system (opens new window)
  • Vuepress-theme-vdoing (opens new window)
  • Gitee (opens new window)
  • Github (opens new window)
  • 简体中文 (opens new window)
  • English (opens new window)

adv display by random ❤️become sponsor
💋Home
  • v2.0.0(current version)
  • What's New

    • What' s New In Easy-Es v2.0.0?
  • history version

    • v1.x.x
  • Upgrade guide

    • Upgrade to 2.x.x instructions
💖Support
  • OS Community
  • Recommend Goods
  • Project PPT (opens new window)
  • Project introduction
  • Project members
  • PR
Join
Customer
  • Doc-Apis (opens new window)
  • Fitness plan automatic generation system (opens new window)
  • Vuepress-theme-vdoing (opens new window)
  • Gitee (opens new window)
  • Github (opens new window)
  • 简体中文 (opens new window)
  • English (opens new window)
  • Quick start

    • Introduction.md
    • Applicable scene
    • Worry free
    • Avoid pit
    • Quick start
    • Springboot demo
    • Spring Integration Guide
    • Solon Integration Guide
    • Config
    • Annotation
  • Core function

    • Condition constructor

      • Introduction of Wrapper
      • Index wrapper
      • Select wrapper
      • Update wrapper
    • Index CRUD

      • Index hosting model
      • Index CRUD
    • Data CRUD

      • Data synchronization solutions
      • Data CRUD
    • Multiple data sources support
    • Dynamic indexing support
    • Four nested query
    • Chain call
      • Chain advantages
      • Chain Constructors
      • Use cases
  • Extended function

    • Mixed query
    • Origin query
    • Page
    • Nested
    • Join parent child
    • Get DSL
    • ExecuteDSL
    • Execute SQL
    • Custom RequestOptions
    • Custom default method
  • High-level syntax

    • Field filtering
    • Sort
    • Aggregation
    • Match&fuzzy match
    • Weight
    • Highlight
    • Geo
    • IP
  • Plugin

    • Plugin
  • Other

    • Faq
    • Difference from MP
    • MySQL and EE syntax comparison
    • Update log
    • Update plan
    • Copyright
    • Thanks
  • v2.xDoc
  • Core function
LaoHan
2023-03-18
目录

Chain call

# Chain advantages

  • Clean code, high readability, easy to maintain.
  • Significantly reduce the amount of code, "code high", the old man next door in the annual debriefing proudly said: that year I put my hands in my pockets, a little out, a line of code to fix all!
  • Coding cool, for developers, the chain has a very obvious advantage is to write code is very cool, with the editor friendly tips can quickly through the drop-down + enter to complete the code, this feeling is like leaders like to do multiple-choice questions rather than fill in the blanks!
  • ...

# Chain Constructors

The conditional constructors and the methods in them originally support Lambda+chaining, but in order to further improve the chaining, the old man next door can realize the need to pretend to be 13 at the annual meeting, We provide a chaining method for each conditional constructor.

// Index Chain Constructor
LambdaEsIndexChainWrapper<T> lambdaChainIndex(BaseEsMapper<T> baseEsMapper);
// Query chain constructor
LambdaEsQueryChainWrapper<T> lambdaChainQuery(BaseEsMapper<T> baseEsMapper);
// Update (including delete) chain constructor
LambdaEsUpdateChainWrapper<T> lambdaChainUpdate(BaseEsMapper<T> baseEsMapper);
1
2
3
4
5
6

The above constructors are dependent on the EsWrappers (Wrappers in MP) tool class

# Use cases

    @Test
    public void testOne() {
        // chain call written by the old man next door
        Document document = EsWrappers.lambdaChainQuery(documentMapper).eq(Document::getTitle, "Old Man Next Door").one();
    }    

    @Test
    public void testSelectOne() {
        // Half-assed chain call written by the old man next door
        LambdaEsQueryWrapper<Document> wrapper = new LambdaEsQueryWrapper<>();
        wrapper.eq(Document::getTitle, "The Old King Next Door")
                .limit(1);
        Document document = documentMapper.selectOne(wrapper);
    }
1
2
3
4
5
6
7
8
9
10
11
12
13
14

提示

If the leader does not know much about technology, this 13 will be installed by the old man, the old man's chain call in all aspects seem to have more advantages! So the old man next door smoothly promoted, the year-end prize is higher, marry the rich white beauty, the old king next door fainted in the toilet...

Help us improve this document (opens new window)
Last update: 2024/03/29
Four nested query
Mixed query

← Four nested query Mixed query→

Theme by Vdoing | Copyright © 2021-2025 LaoHan | Zhejiang ICP No. 2022020479 | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式