<?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> |