mybatis-generator-core工具使用

1、下载mybatis-generator-core包:
相关jar包,请在此下载
2、配置generatorConfig.xml

  
  
<generatorConfiguration>  
  
    <classPathEntry  location="mysql-connector-java-5.1.25-bin.jar"/>  
    <context id="DB2Tables"  targetRuntime="MyBatis3">  
        <commentGenerator>  
            <property name="suppressDate" value="true"/>  
              
            <property name="suppressAllComments" value="true"/>  
        commentGenerator>  
          
        <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.*.*:3306/zhuxue" userId="***" password="***">  
        jdbcConnection>  
        <javaTypeResolver>  
            <property name="forceBigDecimals" value="false"/>  
        javaTypeResolver>  
          
        <javaModelGenerator targetPackage="alipay.openplatform.edu.campus.zhuxuejin.model.pojo" targetProject="src">  
            <property name="enableSubPackages" value="true"/>  
            <property name="trimStrings" value="true"/>  
        javaModelGenerator>  
          
        <sqlMapGenerator targetPackage="test" targetProject="src">  
            <property name="enableSubPackages" value="true"/>  
        sqlMapGenerator>  
          
        <javaClientGenerator type="XMLMAPPER" targetPackage="alipay.openplatform.edu.campus.zhuxuejin.dao.mappers.order" targetProject="src">  
            <property name="enableSubPackages" value="true"/>  
        javaClientGenerator>  
          
        <table tableName="apply_order" domainObjectName="ApplyOrder" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">table>
        <table tableName="apply_student_fmaily_member_info" domainObjectName="ApplyStudentFmailyMemberInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">table>
        <table tableName="apply_student_info" domainObjectName="ApplyStudentInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">table>

        <table tableName="order_info" domainObjectName="OrderInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">table>
        <table tableName="trade_main_flow" domainObjectName="TradeMainFlow" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">table>
        <table tableName="trade_operate_log" domainObjectName="TradeOperateLog" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">table>
        <table tableName="user_base_info" domainObjectName="UserBaseInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false">table>

    context>  
generatorConfiguration>  

3、终端运行(以mac为例)
进入lib

wangdandeMacBook-Pro:mybatis-generator-core-1.3.2 wangdan$ cd lib/
wangdandeMacBook-Pro:lib wangdan$ java -jar mybatis-generator-core-1.3.2.jar -configfile generatorConfig.xml -overwrite

4、进入src下查看一下
mybatis-generator-core工具使用_第1张图片
看下吧!生成的xml,pojo以及service

你可能感兴趣的:(●,数,据,库)