Eclipse配置 MyBatis Generator

1.插件安装

     官网 http://www.mybatis.org/generator/index.html

     插件地址: https://dl.bintray.com/mybatis/mybatis-generator

2新建generatorConfig.xml

     插件安装完成后  右键---新建--other--mybatis 。

    默认在项目目录下新建generatorConfig.xml 

3配置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>
  <classPathEntry location="/home/cooperay/.m2/repository/mysql/mysql-connector-java/5.1.34/mysql-connector-java-5.1.34.jar"/>
  <context id="context1">
  
  <commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
 
    <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.99.253/mlmerp" userId="root" password="password"/>
    <javaModelGenerator targetPackage="com.cooperay.facade.manage.entity" targetProject="cop-service-base">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
    <sqlMapGenerator targetPackage="mybatis.mapper" targetProject="cop-service-base">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
    <javaClientGenerator type="XMLMAPPER" targetPackage="mlm.dao.base" targetProject="cop-service-base">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
    <table tableName="billnumber" domainObjectName="BillNumber" enableCountByExample="false" 
    enableUpdateByExample="false" enableDeleteByExample="false" 
    enableSelectByExample="false" selectByExampleQueryId="false"/>
  </context>
</generatorConfiguration>

 

 

你可能感兴趣的:(Eclipse配置 MyBatis Generator)