Mybatis 的逆向工程的配置文件

db.properties

jdbc.driver = com.mysql.jdbc.Driver

jdbc.url = jdbc:mysql://localhost:3306/mybatis?characterEncoding=utf-8

jdbc.username = root

jdbc.password = 123456



#数据库中要生成的表

jdbc.table.items = items

jdbc.table.orders = orders

jdbc.table.orderdetail = orderdetail

jdbc.table.user = user
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>
 
  <properties resource="db.properties"/>
   
  <context id="testTables" targetRuntime="MyBatis3">
  <commentGenerator>
 
  <property name="suppressAllComments" value="true" />
  commentGenerator>
 
  <jdbcConnection driverClass="${jdbc.driver}"
  connectionURL="${jdbc.url}" userId="${jdbc.username}"
  password="${jdbc.password}">
  jdbcConnection>
 
 
   
 
  <javaTypeResolver>
  <property name="forceBigDecimals" value="false" />
  javaTypeResolver>
   
 
  <javaModelGenerator targetPackage="cn.michael.ssm.po"
  targetProject=".\src">
 
  <property name="enableSubPackages" value="false" />
 
  <property name="trimStrings" value="true" />
  javaModelGenerator>
 
  <sqlMapGenerator targetPackage="cn.michael.ssm.mapper"
  targetProject=".\src">
 
  <property name="enableSubPackages" value="false" />
  sqlMapGenerator>
 
  <javaClientGenerator type="XMLMAPPER"
  targetPackage="cn.michael.ssm.mapper"
  targetProject=".\src">
 
  <property name="enableSubPackages" value="false" />
  javaClientGenerator>
 
  <table tableName="${jdbc.table.items}">table>
  <table tableName="${jdbc.table.orders}">table>
  <table tableName="${jdbc.table.orderdetail}">table>
  <table tableName="${jdbc.table.user}">table>
 
   
 
  context>
  generatorConfiguration>


你可能感兴趣的:(Mybatis 的逆向工程的配置文件)