当前位置:网站首页>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
边栏推荐
- ot initialized – call ‘refresh’ before invoking lifecycle methods via the context: Root WebApplicati
- Fastcgi CGI shallow understanding
- Go sync. WaitGroup
- [kubernetes series] k8s set mysql8 case insensitive
- Numpy creates an empty array data = np empty(shape=[1, 64,64,3])
- Advanced usage of go language for loop break and continue
- Error on datetime when importing SQL file from MySQL
- 重磅:国产IDE发布,由阿里研发,完全开源!
- ThinkPHP show method parameter controllable command execution
- XSS challenge (6-10) more detailed answers
猜你喜欢

Crypto questions

Error on datetime when importing SQL file from MySQL

MFQE 2.0: A New Approach for Multi-FrameQuality Enhancement on Compressed Video

【BUUCTF】 EasySql
![[geek challenge 2019] PHP problem solving record](/img/bf/038082e8ee1c91eaf6e35add39f760.jpg)
[geek challenge 2019] PHP problem solving record

Attack and defense world web questions

The first three passes of sqli Labs

What network security problems are exposed when a large-scale QQ number theft event occurs?
![[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)

QQ was stolen? The reason is
随机推荐
从控制层返回到js的json数据带“\”转译符,怎么去掉
LeetCode_ Stack_ Medium_ 227. basic calculator II (without brackets)
[scientific research data processing] [basic] category variable frequency analysis chart, numerical variable distribution chart and normality test (including lognormal)
Flat shading with unity
XSS challenge (6-10) more detailed answers
JS delete the objects in the array and specify to delete the objects
The programming competition is coming! B station surrounding, senior members and other good gifts to you!
Att & CK red team evaluation field (I)
The JSON data returned from the control layer to JS has a "\" translator. How to remove it
Begin End use the pit encountered
想请教一下,我在佛山,到哪里开户比较好?手机开户是安全么?
org. json. The jsonobject object is converted to JSON, and JSON adds new elements. The value is obtained according to the JSON key. And list object format string to jsonarray
JS time conversion standard format, timestamp conversion standard format
Introduction to the construction and development of composer private warehouse
Jetpack compose for perfect screen fit
Use PHP to delete the specified text content in the file
When SQL queries are performed in table storage, an error is reported when the primary key is added to the query result, and the query result exceeds 10W rows. Do you want to add multiple indexes to t
Advanced usage of go language for loop break and continue
@component使用案例
Deep understanding Net (2) kernel mode 4 Summary of kernel pattern constructs
