One idea a reverse engineering plug-in

Preface
forward engineering company previously used (forward engineering: generate Java code ----> database tables) write the structure of table fields and tables in the Java code to map to the database and generates the table structure, but in the use the process found some deficiencies.
So I was thinking, you can build the first database, and then generate code? With this question, so I take advantage of this period to study the epidemic mybatis reverse engineering (reverse engineering: Database ----> Java code that can be for a single table automatic generation of entity classes and other codes (mapper.java, mapper.xml, pojo ...) can make them siege lion will focus more on complex business logic) Next, we go to learn this mybatis reverse engineering use (single table)
1. to achieve the required installation of reverse engineering in the idea plug-in?

  • 1.1 first need to install mybatis

Setting-Plugins- search "Mybatis Plugin" - Click Install
Here Insert Picture Description

  • 1.2 Installation easyCode

Setting-Plugins- search "easyCode" - Click Install
Here Insert Picture Description

  • 1.3 Restart idea

How 2.idea connect to the database?
Select the database corresponding to the type you want to connect, I used here is the mysql database
Here Insert Picture Description

  • 2.1 database input address, port number, user name, password, database name

Here Insert Picture Description

  • 2.2 Configuration driving connection

Here Insert Picture Description

  • 2.3 Click Test Connection, click Apply after successful

How to generate code 3. Connect?

  • 3.1 selection table, and select Generate Code

Here Insert Picture Description

  • Select Code Type 3.2 generation

Here Insert Picture Description

  • 3.3 generate success

Here Insert Picture Description
This is the idea provided in the mybatis and easyCode plug-ins, after the development will not have to spend time re-writing the code of a single table. I am not feeling a lot easier, hey!
I will continue to learn more behind the technology, and share with everyone!

Smart for hard work, genius is the accumulation. - Hua

Published 29 original articles · won praise 12 · views 3617

Guess you like

Origin blog.csdn.net/weixin_44146379/article/details/104574319