In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
MybatisX rapid development plug-in process is how, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
Brief introduction
MybatisX is a rapid development plug-in based on IDEA, which makes it easy to simplify tedious repetitive operations and improve the development speed at the beginning of using mybatis and mybatis-plus.
Note: idea needs the latest version to take effect. I use version 2020.3.
Basic function 1.xml Jump
After adding the plug-in, there will be an extra bird wearing a red headscarf in the dao layer, and there will also be a bird wearing a blue headscarf before the corresponding xml file method. Click to jump between dao and xml files.
two。 Code generation
After writing the interface in the development, you should also write the corresponding xml method in xml. With MybatisX, you only need to write the corresponding method in dao, then press Alt+Enter to automatically generate the corresponding mapping method in xml. Mom no longer has to worry about mismapping!
Insert a picture description here
In xml:
Just write sql directly!
What?? You don't even want to write a simple sql? Yes, MybatisX directly generates all the additions, deletions, queries and changes related to the entity for you. Use idea to connect to your database, select a favorite object (a table), and right-select Mybatis-Generator.
Choose the configuration (you can choose by yourself, if you don't have it by default):
This is to help you with dao, pojo and xml, in fact, the previous mybatis code generation is the same, but MybatisX is directly processed into a visual configuration, omitting the configuration, but it is generated in the generator folder, how to set the location of its generation, temporarily do not understand, just manually move to the right place
It's really great, mom doesn't have to worry about my miswriting dao, pojo and xml anymore!
3.JPA hints and build statements
MybatisX will write the method name based on the entity field
A: that's it.
B: don't worry, what's more, it will also generate the corresponding sqlaccountants according to the method name!
A: Nani!
Right! MybatisX will also generate the corresponding method based on the method name you write (provided you write a hump mapping like mine), and then Alt+Enter will select Generate Mybbatis Sql
The corresponding dao method can be generated.
And the sql in xml is also automatically generated for us, isn't it very convenient?
Whether it is adding, querying, or deleting, MybatisX will generate the corresponding method and xml as long as it is written according to the rules.
Aah! Mom doesn't have to worry anymore. I won't. No, no! Kid, pay attention to this editor, what else can't you do? Just do it, Ollie. Here!
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.