In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
How to use the mybatis generator code generator? for this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.
Introduction to MyBatis Generator
MyBatis Generator (MBG) is the code generator for MyBatis MyBatis and iBATIS. It will generate code for all versions of MyBatis and iBATIS versions after version 2.2.0. It will introspect the database tables (or many tables) and generate artifacts that can be used to access the tables. This reduces the initial hassle of setting up objects and configuration files to interact with database tables. MBG seeks to have a significant impact on most database operations of simple CRUD (create, retrieve, update, delete). You still need to manually write SQL and object code for join queries or stored procedures.
MyBatis Generator download
1. Source code address: https://github.com/mybatis/generator/releases
two。 Official document: http://www.mybatis.org/generator/index.html
Let's take a look at the use of the mybatis generator code generator. The starting structure diagram is as follows:
Introduction of maven files
4.0.0 com.ding mybatis_generator 1.0-SNAPSHOT org.mybatis.generator mybatis-generator-core 1.3.7 org.mybatis mybatis 3.5.7 compile org.mybatis.generator mybatis-generator-maven-plugin 1. 3.2 src/main/resources/generatorConfig.xml
Database
| | Create Table |-- | | CREATE TABLE `student` (| | `id` int (11) NOT NULL AUTO_INCREMENT, | | `NAME` varchar (20) DEFAULT NULL | | `age` int (11) DEFAULT NULL, | | PRIMARY KEY (`id`) | |) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=u |
Write generatorConfig.xml
Generate
The generated structure diagram
The world will not stop because you are tired.
The answer to the question about how to use the mybatis generator code generator is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
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.