Installation and use of the MyBatis generator plugin in eclipse

Source: Internet
Author: User
Tags generator
MyBatis can also generate code in the direction, can generate entity Class (PO), mapper interface and Mapper interface mapping files, can reduce the workload of our Code. The detailed steps are as follows

1, download MyBatis Build Rack Package tool Mybatis_generator_1.3.1.zip, unpack the rack package to the features, plugins folder of the package is copied to the Eclipse installation directory features, plugins folder. Restarting eclipse is OK.

After extracting the image as follows:


Eclipse path as shown in figure:


Copy Replacement as shown:


2, create Generatorconfig.xml file, install MyBatis can create Generatorconfig.xml


3, configure the Generatorconfig.xml configuration file, details as follows

[html]  View plain  copy   <?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>       <!-- <classPathEntry  location= "D:\rep\mysql\mysql-connector-java\5.1.19\mysql-connector-java-5.1.19.jar"  /> -->         <classpathentry location= "D:\repo\com\oracle\ojdbc14\ 10.2.0.1.0\ojdbc14-10.2.0.1.0.jar " />       <context id=" Db2tables " targetruntime=" MyBatis3 ">           < commentgenerator>               < Property name= "SuppRessallcomments " value=" true " />                <property name= "Suppressdate"  value= "true"  />            </commentGenerator>               <jdbcconnection driverclass= "Oracle.jdbc.driver.OracleDriver"  connectionurl= "Jdbc:oracle:thin: @xxx. Xxx.xxx.xxx:1521:orcl4"  userid= "xxx"  password= "xxxx"  />              <javaTypeResolver>                <property name= " Forcebigdecimals " value=" false " />  

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.