<?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">mybatis <generatorConfiguration> <!-- 指定mysql的驅動包的路徑(禁止放在有中文的目錄下) --> <classPathEntry location="D://maven//maven-dependcies//m2//repository//mysql//mysql-connector-java//5.1.46//mysql-connector-java-5.1.46.jar" />app <!-- 配置數據源和生成代碼所存放的位置 --> <context id="cont" targetRuntime="MyBatis3"> <commentGenerator> <!-- 抑制警告 --> <property name="suppressTypeWarnings" value="true" /> <!-- 是否去除自動生成的註釋 true:是 : false:否 --> <property name="suppressAllComments" value="true" /> <!-- 是否生成註釋代時間戳 --> <property name="suppressDate" value="true" /> </commentGenerator>dom <!--數據庫鏈接的信息:驅動類、鏈接地址、用戶名、密碼 --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="數據庫地址" userId="用戶名" password="密碼" /> <!-- 所生成實體類的位置默認的資源包 --> <javaModelGenerator targetPackage="com.demo.model" targetProject="Demo"> <property name="enableSubPackages" value="false" /> <property name="trimStrings" value="true" /> </javaModelGenerator>eclipse <!-- 所生成的sqlmap的映射文件的位置,默認資源包src --> <sqlMapGenerator targetPackage="com.demo.mapper" targetProject="Demo"> <property name="enableSubPackages" value="true" /> </sqlMapGenerator>maven <javaClientGenerator type="XMLMAPPER" targetPackage="com..mapper" targetProject="merchant-open-api"> <property name="enableSubPackages" value="true" /> </javaClientGenerator> <!-- 爲哪些表生成映射文件 tableName:表名 schema:寫空便可 --> <table schema="" tableName="表名" enableCountByExample="false" domainObjectName="User" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> </table> </context> </generatorConfiguration> |