<?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>
<!-- 本地jar包 -->
<classPathEntry location="D:\maven\maven\MavenRespotion\mysql\mysql-connector-java\5.1.42\mysql-connector-java-5.1.42.jar" />
<!-- MyBatis3Simple:不生成 Example相关类及方法 defaultModelType="flat" -->
<context id="appInfo" targetRuntime="MyBatis3Simple" defaultModelType="flat">
<property name="mergeable" value="false"/>
<!-- 生成的Java文件的编码 -->
<property name="javaFileEncoding" value="UTF-8" />
<!-- 格式化java代码 -->
<property name="javaFormatter" value="org.mybatis.generator.api.dom.DefaultJavaFormatter" />
<!-- 格式化XML代码 -->
<property name="xmlFormatter" value="org.mybatis.generator.api.dom.DefaultXmlFormatter" />
<!-- 指定生成 Mapper 的继承模板 -->
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<property name="mappers" value="tk.mybatis.mapper.common.Mapper"/>
<property name="caseSensitive" value="false"/>
<property name="forceAnnotation" value="false"/>
<property name="beginningDelimiter" value=""/>
<property name="endingDelimiter" value=""/>
<property name="lombok" value="Setter,Getter"/>
</plugin>
<commentGenerator>
<property name="suppressDate" value="true" />
<property name="addRemarkComments" value="true" />
</commentGenerator>
<!-- 连接数据库 -->
<jdbcConnection connectionURL="jdbc:mysql://ip:3306/dbbase" driverClass="com.mysql.jdbc.Driver" password="pwd" userId="user" >
<!--设置为 true 可以获取 tables 信息, 解决生成文件缺少 xxxByPrimaryKey 的问题 -->
<property name="useInformationSchema" value="true"/>
</jdbcConnection>
<!-- 生成代码位置 -->
<javaModelGenerator targetPackage="com.mybatis.mapper.domain" targetProject="cloud-domain/src/main/java" />
<sqlMapGenerator targetPackage="videoMapper" targetProject="-cloud-biz/src/main/resources" />
<javaClientGenerator targetPackage="com.mybatis.mapper" targetProject="-cloud-biz/src/main/java" type="XMLMAPPER" />
<table tableName="table_name">
<generatedKey column="activity_id" sqlStatement="MySql" identity="true"/>
</table>
</context>
</generatorConfiguration>
tk.mapper 的 Generator 插件 代码生成器
最新推荐文章于 2024-06-26 10:55:47 发布