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
        • LambdaEsUpdateWrapper
          • set
    • 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
目录

Update wrapper

# LambdaEsUpdateWrapper

This conditional constructor is mainly used to update the data when you need to update the fields and their values or the encapsulation of the query conditions

The encapsulation of the query conditions is the same as the methods provided in the LambdaEsQueryWrapper, the only difference is the set method

# set

set(String column, Object val)
set(boolean condition,String column,Object val)
1
2
  • SQL SET field
  • Example: set("name", "Lao Li Tou")
  • Example: set("name", "")--->Database field value becomes empty string
  • Example: set("name", null)--->Database field value becomes null

Use case:

    /**
     * LambdaEsUpdateWrapper Use Case - Update data based on conditions
     */
    @Test
    public void testUpdate() {
        // case1: update by condition and entity object update
        LambdaEsUpdateWrapper<Document> wrapper = new LambdaEsUpdateWrapper<>();
        wrapper.eq(Document::getTitle, title1);
        Document document = new Document();
        document.setTitle("The Old King Next Door King");
        document.setContent("push* technology too soft");
        document.setCustomField("Ullabala in the magic fairy");
        documentMapper.update(document, wrapper);

        // case2 Another simple way to omit entities, the syntax is the same as MP
        LambdaEsUpdateWrapper<Document> wrapper1 = new LambdaEsUpdateWrapper<>();
        wrapper1.eq(Document::getTitle, title1);
        wrapper1.set(Document::getContent, "push*technology too soft")
                .set(Document::getCustomField, "ura bara in magic fairy");
        documentMapper.update(null,wrapper1);
    }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Help us improve this document (opens new window)
Last update: 2024/03/29
Select wrapper
Index hosting model

← Select wrapper Index hosting model→

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