多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
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> ```