Example Analysis of mybatis reverse Engineering
This article shares with you the content of a sample analysis of mybatis reverse engineering. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
one. Mybatis reverse engineering
In the past, during the live broadcast, some friends saw that the editor used the tool to generate mybatis entity classes, mapper files and dao,service,controller. Now the editor and everyone write it step by step, but the train of thought is not complicated. Get connection from datasource, meta information from connection, fields, notes and so on. In fact, the core code can be done in a few lines. As shown in the following figure:
Click the source code to view:
Https://github.com/idea-share/java_tools/blob/master/tools-admin/src/test/java/cloud/javastudy/admin/MainApplicationTests.java
two. Springboot multi-environment configuration
Sometimes, we do not want to configure the database, but sometimes we do use the database, so it is very inconvenient to delete, add and delete each time. Therefore, there is a multi-environment configuration, which is easier. Just rename the file, as shown in the following figure:
Just pay attention to the correspondence of the file name
three. Tools-base project initialization
This module only encapsulates some common functions of jdk, such as this initialization writes a common tool method: convert the first letter of String to uppercase, followed by lowercase.
Thank you for reading! This is the end of this article on "sample Analysis of mybatis reverse Engineering". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!