maven mybatis 自动生成

maven 添加
   <!-- 自动生成表对应POJO -->
    <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>
编写配置脚本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="E:\apache-maven-3.3.9\lib\ext\ojdbc6.jar" />
    <context id="context1" targetRuntime="MyBatis3">
        <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
            connectionURL="jdbc:oracle:thin:@000.000.000.000:1521:xxx"
            userId="xxxxxxx" password="xxxxxx" />
<!--
javaTypeResolver标签意义
false:
This is the default value 
When the property is false or unspecified, 
the default Java type resolver will attempt to make JDBC DECIMAL and NUMERIC types easier to work with by substituting Integral types if possible.
The substitution rules are as follows:
1. If the scale is greater then zero, or the length is greater than 18, then the java.math.BigDecimal type will be used.  
2. If the scale is    zero,    and the length is 10 through 18, then the Java type resolver    will    substitute a java.lang.Long.  
3. If the scale is zero, and the    length is    5 through 9, then the Java type resolver will substitute    a    java.lang.Integer.  
4. If the scale is zero, and the length is less    than    5, then the Java type resolver will substitute a    java.lang.Short.
true:
When the property is true, the Java type resolver will always use java.math.BigDecimal if the database column is of type DECIMAL or NUMERIC.
-->
        <javaTypeResolver>
            <property name="forceBigDecimals" value="false"/>
        </javaTypeResolver>
        <javaModelGenerator targetPackage="com.linkage.serviceplatform.entity"
            targetProject="D:\JAVA_HOME\mybatis-generator\entity" />
        <sqlMapGenerator targetPackage="com.linkage.serviceplatform.mapper"
            targetProject="D:\JAVA_HOME\mybatis-generator\mapper" />
        <javaClientGenerator targetPackage="com.linkage.serviceplatform.mapper"
            targetProject="D:\JAVA_HOME\mybatis-generator\xml" type="XMLMAPPER" />
        <table  tableName="TF_F_CUSTOMERREC" />
        <table  tableName="TF_OUT_TRADE_ADDITIONAL" />
        <table  tableName="TF_OUT_ADDTRADE" />
        <table  tableName="TD_M_SAM" />
        <table  tableName="TF_OUTSUPPLY_COMMIT" />
        <table  tableName="TF_OUT_RETRADE_ADDITIONAL" />
        <table  tableName="TF_B_WARN_BLACK" />
        <table  tableName="TF_F_CARDREC" />
        <table  tableName="TF_F_CARDREC" />
        <table  tableName="TF_F_CARDEWALLETACC" />
        <table  tableName="TF_F_CARDUSEAREA" />
        <table  tableName="TF_F_BALANCE_PAYOUT" />
        <table  tableName="TF_B_TRADE_ACCOUNT"  />
        <table  tableName="TD_M_PAYMENTSTAFF"   />
        <table  tableName="TF_B_TRADE"  />
        <table  tableName="TF_B_TRADEFEE" />
        <table  tableName="TD_SEQ_ID"  />
        <table  tableName="TF_F_CUST"  />
    </context>
</generatorConfiguration>
执行maven脚本
  mvn mybatis-generator:generate
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值