Installation of the Mybatis_generator tool---mybatis code generator (plug-in)--mybatis reverse engineering generation model and XML and DAO

Source: Internet
Author: User

MyBatis code generator (plugin)

--Install the plugin:

1. Unzip the Mybatis_generator_1.3.1.zip file

2. Copy the Features,pougins folder to the C:\Users\chufeng\MyEclipse\MyEclipse10\soft\mybatis directory (C:\Users\pc_name\MyEclipse\ MyEclipse 10\ for myeclipse installation directory, soft\mybaits can create it yourself)

3. Go to the C:\Users\chufeng\MyEclipse\MyEclipse10\dropins directory and create a new Mybatis.link file, add the content: path=c:\\users\\pc_name\\myeclipse\\ MyEclipse 10\\soft\\mybatis

4. Start MyEclipse

--Using plugins

5. Add the Generatorconfig.xml file to the project and modify the relevant content. Right build can find generator MyBatis artifacts generated

Generatorconfig.xml
<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE generatorconfiguration Public "-//mybatis.org//dtd mybatis Generator Configuration 1.0//en" "/http Mybatis.org/dtd/mybatis-generator-config_1_0.dtd "><generatorConfiguration><!--<properties Resource= "Conn.properties"/>---<classpathentry location= "E:\tools\lib\mysql_driver\ Mysql-connector-java-5.1.26-bin.jar "/><!--specifies that the runtime is MYBATIS3 version--><context id=" Testtables " Targetruntime= "MyBatis3" ><commentGenerator><!--whether to uncomment--><property name= "Suppressallcomments" Value= "true"/> <!--generate comment generation timestamp--><property name= "Suppressdate" value= "true"/></commentgenerator ><!--JDBC Connection information--><jdbcconnection driverclass= "Com.mysql.jdbc.Driver" connectionurl= "jdbc:mysql:// Localhost:3306/scm?useunicode=true&characterencoding=utf-8 "userid=" root "password=" root "></       jdbcconnection> <!--Targetpackage Specify the model in which package is generated, Targetproject specify the project's SRC,--> <javamodelgenerator targetpackage= "cn.buaa.scm.entity" targetproject= "scm/src" ><!--remove space before and after fields-->< Property Name= "Trimstrings" value= "false"/></javamodelgenerator><!--configuration SQL Map file generation information-->< Sqlmapgenerator targetpackage= "Cn.buaa.scm.dao" targetproject= "SCM/SRC"/><!--Configure DAO interface generation information-->< Javaclientgenerator type= "Xmlmapper" targetpackage= "Cn.buaa.scm.dao" targetproject= "SCM/SRC"/><table Tablename= "Account" domainobjectname= "account"/><table tablename= "Supplier" domainobjectname= "Supplier"/ ></context></generatorConfiguration>
Note: After completion, remember to implement the entity serializable, rewrite the ToString () method, easy to use later

Installation of the Mybatis_generator tool---mybatis code generator (plug-in)--mybatis reverse engineering generation model and XML and DAO

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.