commentGenerator用于定义生成注释的规则[[官网](http://mybatis.org/generator/configreference/commentGenerator.html)],推荐配置:(禁用注释)
```xml
<generatorConfiguration>
<context id="simple" targetRuntime="MyBatis3Simple">
<commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
</context>
</generatorConfiguration>
```
targetRuntime属性:[官网详情](http://mybatis.org/generator/configreference/context.html)
- [x] MyBatis3DynamicSql(默认值)
- [ ] MyBatis3Kotlin
- [x] MyBatis3
- [x] MyBatis3Simple
- [ ] MyBatis3DynamicSqlV1【标记**已过时**】
# 配置示例
在`Resource`目录下创建`generatorConfig.xml`文件,内容如下:
```xml
<?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>
<context id="gosuncn" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC"
userId="root"
password="root"/>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/><!--default-->
<property name="commentGenerator" value="true"/>
</javaTypeResolver>
<javaModelGenerator targetPackage="com.gosuncn.entity" targetProject="src/main/java">
<property name="enableSubPackages" value="false"/><!--default-->
<property name="trimStrings" value="false"/><!--default-->
</javaModelGenerator>
<sqlMapGenerator targetPackage="com.gosuncn.dao" targetProject="src/main/java">
<property name="enableSubPackages" value="false"/><!--default-->
</sqlMapGenerator>
<javaClientGenerator type="XMLMAPPER" targetPackage="com.gosuncn.dao" targetProject="src/main/java">
<property name="enableSubPackages" value="false"/><!--default-->
</javaClientGenerator>
<table tableName="student"/>
</context>
</generatorConfiguration>
```
- springboot使用mybatis
- MyBatis入门
- MyBatis注解方式
- 从零开始MyBatis保存操作
- MyBatis更新操作
- MyBatis删除操作
- MyBatis根据Id查询用户
- MyBatis根据名称模糊查询用户1
- MyBatis根据名称模糊查询用户2
- MyBatis查询总记录条数
- MyBatis获取插入时自增的Id
- MyBatis传参类型
- MyBatis返回值字段不匹配
- MyBatis之properties标签
- MyBatis类型别名typeAliases
- mybatis逆向工程maven之pom配置
- configurationFile
- verbose
- overwrite
- includeCompileDependencies
- includeAllDependencies
- maven之pom配置总结版
- 逆向工程generatorConfig配置