Mybatis-generator-gui-an interface tool for Automatic Generation of mybatis code, mybatisgeneratorgui

Source: Internet
Author: User

Mybatis-generator-gui-an interface tool for Automatic Generation of mybatis code, mybatisgeneratorgui

    • What is mybatis-generator-gui?
        • Before introducing mybatis-generator-gui, it is necessary to introduce what is mybatis generator (you can skip this section if you are familiar with it ). we all know that, when writing a Mybatis application, you need to write sqlmap, object class, Dao interface, and Dao implementation class. You need to configure it manually for hundreds of thousands of database tables, this is a terrible workload, and it is repetitive and prone to errors. therefore, Mybatis also officially launched a jar package for the Mybatis code generation tool, which is the mybatis-generator mentioned in this Article. For details, refer to MyBatis Generator. It mainly provides the following functions:

        • Mybatis-generator-gui isDeveloped based on mybatis generatorAn interface tool that allows you to easily and quickly generate Java POJO files and database ing files of Mybatis. The xml configuration provided by the official website is very flexible and may be preferred for those familiar with it. This tool is easier for beginners to get started.

      Core features
        • Easily generate code by following the interface steps, eliminating the hassle of learning and configuring XML
        • Save the database connection and Generator configuration, and easily implement each code generation.
        • Built-in common plug-ins, such as offset Paging
        • (Optional) Remove comments that are unfriendly to version management. This makes it clearer to add or delete fields and regenerate files.
        • Currently, Mysql, Oracle, and PostgreSQL are supported.
        • Start as follows:
    • How to Use mybatis-generator-gui
    • The installation and use methods are detailed in the official documentation:
      • For the installation method, refer to the official Github address.
      • Usage: Usage-Guide

 

It is very important to add the following configuration to automatically scan the ER interface, so you do not need to define the bean objects of mapper separately:

<Bean id = "xxxMapperScannerConfigurer" class = "org. mybatis. spring. mapper. MapperScannerConfigurer">

<Property name = "basePackage" value = "compeichenchen. test. mapper;"/>

<Property name = "sqlSessionFactoryBeanName" value = "testSqlSessionFactory"/>

</Bean>

      Note:This method will cause the loading configuration of spring placeholder to fail.

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.