MBG生成规则添加注释
This commit is contained in:
@@ -6,38 +6,44 @@
|
|||||||
<generatorConfiguration>
|
<generatorConfiguration>
|
||||||
<properties resource="generator.properties"/>
|
<properties resource="generator.properties"/>
|
||||||
<context id="MySqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
|
<context id="MySqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
|
||||||
|
<!-- 配置SQL语句中的前置分隔符 -->
|
||||||
<property name="beginningDelimiter" value="`"/>
|
<property name="beginningDelimiter" value="`"/>
|
||||||
|
<!-- 配置SQL语句中的后置分隔符 -->
|
||||||
<property name="endingDelimiter" value="`"/>
|
<property name="endingDelimiter" value="`"/>
|
||||||
|
<!-- 配置生成Java文件的编码 -->
|
||||||
<property name="javaFileEncoding" value="UTF-8"/>
|
<property name="javaFileEncoding" value="UTF-8"/>
|
||||||
<!-- 为模型生成序列化方法-->
|
<!-- 为模型生成序列化方法 -->
|
||||||
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
|
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
|
||||||
<!-- 为生成的Java模型创建一个toString方法 -->
|
<!-- 为生成的Java模型创建一个toString方法 -->
|
||||||
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
|
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
|
||||||
<!--生成mapper.xml时覆盖原文件-->
|
<!-- 生成mapper.xml时覆盖原文件 -->
|
||||||
<plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />
|
<plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />
|
||||||
<commentGenerator type="com.macro.mall.CommentGenerator">
|
<commentGenerator type="com.macro.mall.CommentGenerator">
|
||||||
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
|
<!-- 是否阻止生成的注释 -->
|
||||||
<property name="suppressAllComments" value="true"/>
|
<property name="suppressAllComments" value="true"/>
|
||||||
|
<!-- 是否阻止生成的注释包含时间戳 -->
|
||||||
<property name="suppressDate" value="true"/>
|
<property name="suppressDate" value="true"/>
|
||||||
|
<!-- 是否添加数据库表的备注信息 -->
|
||||||
<property name="addRemarkComments" value="true"/>
|
<property name="addRemarkComments" value="true"/>
|
||||||
</commentGenerator>
|
</commentGenerator>
|
||||||
|
<!-- 配置MBG要连接的数据库信息 -->
|
||||||
<jdbcConnection driverClass="${jdbc.driverClass}"
|
<jdbcConnection driverClass="${jdbc.driverClass}"
|
||||||
connectionURL="${jdbc.connectionURL}"
|
connectionURL="${jdbc.connectionURL}"
|
||||||
userId="${jdbc.userId}"
|
userId="${jdbc.userId}"
|
||||||
password="${jdbc.password}">
|
password="${jdbc.password}">
|
||||||
<!--解决mysql驱动升级到8.0后不生成指定数据库代码的问题-->
|
<!-- 解决mysql驱动升级到8.0后不生成指定数据库代码的问题 -->
|
||||||
<property name="nullCatalogMeansCurrent" value="true" />
|
<property name="nullCatalogMeansCurrent" value="true" />
|
||||||
</jdbcConnection>
|
</jdbcConnection>
|
||||||
|
<!-- 用于控制实体类的生成 -->
|
||||||
<javaModelGenerator targetPackage="com.macro.mall.model" targetProject="mall-mbg\src\main\java"/>
|
<javaModelGenerator targetPackage="com.macro.mall.model" targetProject="mall-mbg\src\main\java"/>
|
||||||
|
<!-- 用于控制Mapper.xml文件的生成 -->
|
||||||
<sqlMapGenerator targetPackage="com.macro.mall.mapper" targetProject="mall-mbg\src\main\resources"/>
|
<sqlMapGenerator targetPackage="com.macro.mall.mapper" targetProject="mall-mbg\src\main\resources"/>
|
||||||
|
<!-- 用于控制Mapper接口的生成 -->
|
||||||
<javaClientGenerator type="XMLMAPPER" targetPackage="com.macro.mall.mapper"
|
<javaClientGenerator type="XMLMAPPER" targetPackage="com.macro.mall.mapper"
|
||||||
targetProject="mall-mbg\src\main\java"/>
|
targetProject="mall-mbg\src\main\java"/>
|
||||||
<!--生成全部表tableName设为%-->
|
<!-- 配置需要生成的表,生成全部表tableName设为% -->
|
||||||
<table tableName="%">
|
<table tableName="%">
|
||||||
|
<!-- 用来指定主键生成策略 -->
|
||||||
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
|
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
|
||||||
</table>
|
</table>
|
||||||
</context>
|
</context>
|
||||||
|
|||||||
Reference in New Issue
Block a user