Automatic generation of DAO, Model, mapping related files using Mybatis-generator

Source: Internet
Author: User
Tags manual writing

Recently been busy working or looking for work status, long time no write something, today idle to Nothing, record the use of mybatis-generator automatically generated DAO, Model, mapping related files steps.

We all know that hibernate belongs to the automatic Orm,mybatis is semi-automatic ORM, as to the difference between the two, there are a lot of information on the Internet, I do not describe here. In the MyBatis framework use, the most effort is to write mapping mapping files, because manual writing is easy to make mistakes, we can use Mybatis-generator to help us automatically generate files.

1. File download

Mybatis-generator:https://files.cnblogs.com/files/wq-code/mybatis-generator-core-1.3.2.zip
After decompression

  

2. Modify the file

Just download the file is not available to use, need to make some changes

  

In the case of MySQL, there are comments in the text, I will not say more, direct next.

3. Automatic generation

Double-click the Cmd.exe file, paste the corresponding statement in the document, and enter.

To a folder of your own writing, copy the generated files to your project projects

  

4. Wrap Up

At this point, mybatis-generator automatic generation of DAO, Model, mapping related files on the end of the introduction, but the project is just beginning, continue to work hard!

The mountain has the peak, the sea has the other shore, the long distance, finally has the turn, the aftertaste is bitter, finally has the return GAN.

Automatic generation of DAO, Model, mapping related files using Mybatis-generator

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.