|
@@ -0,0 +1,56 @@
|
|
|
+<?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="generator.properties"/>
|
|
|
+ <context id="MySqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
|
|
|
+ <property name="beginningDelimiter" value="`"/>
|
|
|
+ <property name="endingDelimiter" value="`"/>
|
|
|
+ <property name="javaFileEncoding" value="UTF-8"/>
|
|
|
+ <!--生成mapper.xml时覆盖原文件-->
|
|
|
+ <plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"></plugin>
|
|
|
+ <plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
|
|
|
+ <plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin>
|
|
|
+ <plugin type="com.kingtom.kirin.generator.orm.mybatis.KirinMybatisPlugin"></plugin>
|
|
|
+ <!--可以自定义生成model的代码注释-->
|
|
|
+ <commentGenerator type="com.kingtom.kirin.generator.orm.mybatis.KirinCommentGenerator">
|
|
|
+ <!-- 指定生成的java文件的编码,没有直接生成到项目时中文可能会乱码 -->
|
|
|
+ <property name="javaFileEncoding" value="UTF-8"/>
|
|
|
+ <!-- 这个元素用来去除指定生成的注释中是否包含生成的日期 false:表示保护 -->
|
|
|
+ <property name="suppressDate" value="true"/>
|
|
|
+ <!-- 是否去除自动生成的注释 true:是 : false:否 -->
|
|
|
+ <property name="suppressAllComments" value="false"/>
|
|
|
+ <!-- 是否根据备注生成注释 -->
|
|
|
+ <property name="addRemarkComments" value="true"/>
|
|
|
+ <!-- 日期格式 -->
|
|
|
+ <property name="dateFormat" value="yyyy/M/d hh:mm"/>
|
|
|
+ </commentGenerator>
|
|
|
+ <!--配置数据库连接-->
|
|
|
+ <jdbcConnection driverClass="org.postgresql.Driver"
|
|
|
+ connectionURL="jdbc:postgresql://${jdbcConnection.ip}:${jdbcConnection.port}/${jdbcConnection.dbname}"
|
|
|
+ userId="${jdbcConnection.userId}"
|
|
|
+ password="${jdbcConnection.password}">
|
|
|
+ </jdbcConnection>
|
|
|
+ <javaTypeResolver type="com.kingtom.kirin.generator.orm.mybatis.KirinJavaTypeResolver"/>
|
|
|
+ <!--指定生成model的路径-->
|
|
|
+ <javaModelGenerator targetPackage="${javaModelGenerator.targetPackage}" targetProject="${javaModelGenerator.targetProject}"/>
|
|
|
+ <!--指定生成mapper.xml的路径-->
|
|
|
+ <sqlMapGenerator targetPackage="${sqlMapGenerator.targetPackage}" targetProject="${sqlMapGenerator.targetProject}"/>
|
|
|
+ <!--指定生成mapper接口的的路径-->
|
|
|
+ <javaClientGenerator type="XMLMAPPER" targetPackage="${javaClientGenerator.targetPackage}"
|
|
|
+ targetProject="${javaClientGenerator.targetProject}"/>
|
|
|
+ <!--生成全部表tableName设为%-->
|
|
|
+ <table tableName="${table.name}"
|
|
|
+ enableCountByExample="true"
|
|
|
+ enableSelectByExample="true"
|
|
|
+ enableUpdateByExample="true"
|
|
|
+ enableDeleteByExample="true"
|
|
|
+ enableSelectByPrimaryKey="true"
|
|
|
+ enableUpdateByPrimaryKey="true"
|
|
|
+ enableDeleteByPrimaryKey="true"
|
|
|
+ enableInsert="true">
|
|
|
+ </table>
|
|
|
+ </context>
|
|
|
+</generatorConfiguration>
|