Maven Install MyBatis Generator

Source: Internet
Author: User

Always rely on me is not very like the automatic generation of code tools, because the generated code is not very good, adaptability is bad!

Besides, writing some code yourself is not going to cost much time. But at the request of the classmate, I helped him install the MyBatis Generator.

Pom.xml:

<plugins> <plugin> <groupId>org.mybatis.generator</groupId><artifactId> mybatis-generator-maven-plugin</artifactid><version>1.3.2</version><configuration>< Verbose>true</verbose><overwrite>true</overwrite></configuration></plugin> </plugins><dependencies> <dependency><groupId>org.mybatis.generator</groupId>< Artifactid>mybatis-generator-core</artifactid><version>1.3.2</version></dependency> </dependencies>

Put the Generatorconfig.xml file in/voicelog/src/main/resource/:

<?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 ><!--  Set MySQL drive path  --><classPathEntry         location= "D:\Code\maven3\repo\m2\mysql\mysql-connector-java\5.1.37\ Mysql-connector-java-5.1.37.jar " /><!--  here to specify dao -->  < for MYBATIS3 Context id= "Context1"   targetruntime= "MyBatis3" >  <!-- jdbc connection Information  -- >    <jdbcconnection driverclass= "Com.mysql.jdbc.Driver"        connectionurl= "Jdbc:mysql://localhost:3306/yii"      userid= "root"  password= "root"  />    <!--  generate VO objects  -->    <javamodelgenerator targetpackage= "Com.baidu.voice.model"  targetproject= "Voicelog"  />    <!--  Generate example objects for querying  -->    < Sqlmapgenerator targetpackage= "Com.baidu.voice.model"  targetproject= "Voicelog"  />     <!--  Generate DAO's class file and configuration file  -->    <javaclientgenerator  targetpackage= "Com.baidu.voice.dao"  targetproject= "Voicelog"  type= "Xmlmapper"  />     <!--  The database tables you want to generate, the Automation tool generates the corresponding Vo objects based on the structure of the table  -->    <table  schema= ""  tablename= "admin"  >    </table>  </context ></generatorConfiguration>


MyEclipse Installing the MyBatis Generator plugin:

http://mybatis.googlecode.com/svn/sub-projects/generator/trunk/eclipse/UpdateSite/


After successful installation:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/D0/wKioL1cuu6LzBbdpAADXO29MU-Q132.png "title=" 12.png "alt=" Wkiol1cuu6lzbbdpaadxo29mu-q132.png "/>


You can do it!



This article is from the "dream to think XI" blog, please be sure to keep this source http://qiangmzsx.blog.51cto.com/2052549/1771171

Maven Install MyBatis Generator

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.