当前位置:网站首页>Querywrapper in mybaits plus
Querywrapper in mybaits plus
2022-06-30 14:33:00 【tutou_ girl】
One 、queryWrapper What is it?
queryWrapper yes mybatis plus The object encapsulation operation class that implements query in , His hierarchy is as follows

In the picture above ,
Wrapper : Conditionally construct abstract classes , Top parent class , Provided in an abstract class 4 There are two ways to display the source code
AbstractWrapper : Used to encapsulate query conditions , Generate sql Of where Conditions
AbstractLambdaWrapper : Lambda Grammar use Wrapper Unified processing and parsing lambda obtain column.
LambdaQueryWrapper : You can see that the name is used for Lambda Query used by syntax Wrapper
LambdaUpdateWrapper : Lambda Update package Wrapper
QueryWrapper : Entity Object encapsulates the operation class , Not with lambda grammar
UpdateWrapper : Update Conditional encapsulation , be used for Entity Object update operation
Two 、 Use demo
@PostMapping("/login")
public Result login(@Validated @RequestBody JSONObject jsonObject, HttpServletResponse response) {
User us = jsonObject.toJavaObject(User.class);
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("username",us.getUsername()).eq("password",us.getPassword());
User user = userService.getOne(queryWrapper);
Assert.notNull(user, " The user doesn't exist ");
Query the database for a person whose user name and password match those passed in , And encapsulate the results as user
3、 ... and 、QueryWrapper Methods 
Four 、 summary
The blog content above is simple , Only one query function is shown . When you actually use it , May, in accordance with the The methods contained above the condition constructor , Set the conditions for you to query the data , call BaseMapper The corresponding method in
边栏推荐
- MySQL back to table query optimization
- Why does the folder appear open in another program
- Go language for loop multivariable use
- JS delete the objects in the array and specify to delete the objects
- PHP reverses scenarios based on code and skillfully uses debug_ backtrace()
- MV3 04_ Introducing Manifest V3
- Talk about Vue's two terminal diff algorithm, analysis of the rendering principle of the mobile terminal, and whether the database primary key must be self incremented? What scenarios do not suggest s
- @Role of ResponseBody
- [buuctf] [actf2020 freshman competition]exec1
- go time. after
猜你喜欢
![[scientific research data processing] [practice] frequency analysis chart of category variables, distribution chart of numerical variables and normality test (including lognormal)](/img/5a/eaa845f4332f0b8ee8b6409d6a79e8.png)
[scientific research data processing] [practice] frequency analysis chart of category variables, distribution chart of numerical variables and normality test (including lognormal)

DefCamp Capture the Flag (D-CTF) 2021-22 web

1 figure to explain the difference and connection between nodejs and JS

Initial attack and defense world Misc

Race of golang

Lifting scanning tool

Realize a simple LAN communication (similar to feiqiu)

Why does the folder appear open in another program

Go language mutex lock

Ctfshow getting started with the web (ThinkPHP topic)
随机推荐
XSS challenge (1-5) more detailed answers
Cost forecast of PMP (BAC, EAC, etc)
MySQL back to table query optimization
Lfi-rce without controllable documents
Experiment 2: stack
Laravel upload error
[buuctf] [actf2020 freshman competition]exec1
JS time conversion standard format, timestamp conversion standard format
Go language mutex lock
Jetpack compose for perfect screen fit
DiceCTF - knock-knock
DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703
深入理解.Net中的线程同步之构造模式(二)内核模式4.内核模式构造物的总结
After the MySQL service on the local computer is started and stopped, some services will automatically stop when they are not used by other services or programs
Laravel RBAC laravel permission use
JS array
Wechat applet realizes map navigation + door-to-door recycling
"As a service", the inevitable choice of enterprise digital transformation
Crypto questions
Pit used by go language array type
