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
    • 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
    • Condition constructor
    LaoHan
    2023-03-18
    目录

    Introduction of Wrapper

    提示

    If you have previously understood the MP conditional constructors, then you only need to pay attention to MP in the absence of the indexed conditional constructors, the rest is almost the same as MP. The conditional constructor is the core of the entire framework, the CRUD query conditions are basically encapsulated by it, but also relies on it to provide the chain API and MP syntax to simplify the use of the entire ES complex API, it can be understood as a converter or intermediary, as if you want to eat dumplings, you can go to your sister-in-law said you want to eat You can go to your sister-in-law and tell her that you want to eat dumplings stuffed with leeks, and she will do the rest... Wrapper can be created in two ways:

    • Directly new, e.g. new LambdaEsQueryWrapper<>().
    • Created by EsWrappers.lambdaQuery(), which can support chained programming scenarios, against MP's Wrappers

    Description

    • The first input boolean condition that appears below indicates whether the condition is added to the last generated statement, for example: query.like(StringUtils.isNotBlank(name), Entity::getName, name) .eq(age!=null && age >= 0 , Entity::getAge, age)
    • The following block of code has multiple methods to complete the individual boolean input from top to bottom, the default is true
    • The following appearances of the generic Param are all subclass instances of Wrapper (all have all the methods of AbstractWrapper)
    • The following methods appear in the input parameters of R is a generic, in the ordinary wrapper is a String, in the LambdaWrapper is a function (example: Entity::getId, Entity is the entity class, getId is the field id getMethod)
    • R column in the following method parameters are database fields, when the specific type of R is String, it is the name of the database field (field name is the database keyword wrapped in its own escape character!) ! Instead of entity class data field name!!! Another project runtime does not support eclipse's own compiler when the specific type of R is SFunction!
    • The following examples are the use of ordinary wrapper, the reference to Map and List are in the form of json performance!
    • Use if the Map or List reference is empty, it will not be added to the last generated sql!
    • Any questions on the open source code to see, can not see the function click me to learn new knowledge (opens new window)

    Warning

    Wrapper transfer in RPC calls is not supported and discouraged

    1. wrapper is heavy
    2. transferring wrapper is analogous to your controller receiving values in a map (development for a while, maintenance for a crematorium)
    3. the correct posture for RPC calls is to write a DTO for transmission, and the called party then performs the appropriate action according to the DTO We refuse to accept any issue or even pr related to RPC transfer Wrapper error.

    # AbstractWrapper

    Description

    The parent classes of QueryWrapper(LambdaEsQueryWrapper) and UpdateWrapper(LambdaEsUpdateWrapper) are used to generate where conditions for statements, and the entity property is also used to generate where conditions for statements Note: The entity-generated where conditions generated by the entity are not associated with the where conditions generated using the respective api.

    # QueryWrapper

    Description

    Inherits from AbstractWrapper , its own internal property entity is also used to generate where conditions and LambdaEsQueryWrapper

    # UpdateWrapper

    Description

    Inherits from AbstractWrapper , its own internal property entity is also used to generate the where condition and LambdaEsUpdateWrapper

    # AbstractChainWrapper

    Description

    Inherits from Wrapper , used to support chain calls

    Help us improve this document (opens new window)
    Last update: 2024/03/29
    Annotation
    Index wrapper

    ← Annotation Index wrapper→

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