@@ -203,77 +203,7 @@ If no settings are provided, the plugin tries to use sensible defaults.
203
203
</tbody ></table >
204
204
205
205
<h3 id =" run-mbg-task " >Run the mbg task</h3 >
206
- 1 . Add generatorConfig.xml to your execution module.
207
- ```
208
- <?xml version="1.0" encoding="UTF-8"?>
209
-
210
- <!DOCTYPE generatorConfiguration
211
- PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
212
- "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
213
-
214
- <generatorConfiguration>
215
- <!-- mybatis-generator:generate -->
216
- <!--targetRuntime="MyBatis3"-->
217
- <context id="MysqlTables" targetRuntime="tk.mybatis.mapper.generator.TkMyBatis3Impl">
218
-
219
- <!-- generator java file encoding -->
220
- <property name="javaFileEncoding" value="UTF-8"/>
221
- <!-- format java code-->
222
- <property name="javaFormatter" value="org.mybatis.generator.api.dom.DefaultJavaFormatter"/>
223
- <!-- format XML files -->
224
- <property name="xmlFormatter" value="org.mybatis.generator.api.dom.DefaultXmlFormatter"/>
225
- <plugin type="${xml.mapperPlugin}">
226
- <property name="mappers" value="${xml.mapperMapper}"/>
227
- <!-- caseSensitive default false,When the database table name is case sensitive,you can set this property to true -->
228
- <property name="caseSensitive" value="true"/>
229
- </plugin>
230
- <!-- delete generator notes-->
231
- <commentGenerator>
232
- <property name="suppressAllComments" value="true" />
233
- <property name="suppressDate" value="true" />
234
- </commentGenerator>
235
- <jdbcConnection driverClass="${jdbc.driver}"
236
- connectionURL="${jdbc.url}"
237
- userId="${jdbc.username}"
238
- password="${jdbc.password}" />
239
-
240
- <javaTypeResolver>
241
- <property name="forceBigDecimals" value="true" />
242
- </javaTypeResolver>
243
-
244
- <javaModelGenerator targetPackage="${xml.modelPackage}"
245
- targetProject="${xml.javaProject}">
246
- <property name="enableSubPackages" value="true" />
247
- <property name="trimStrings" value="true" />
248
- </javaModelGenerator>
249
-
250
- <sqlMapGenerator
251
- targetPackage="${xml.xmlPackage}"
252
- targetProject="${xml.resourcesProject}" >
253
- <property name="enableSubPackages" value="false" />
254
- </sqlMapGenerator>
255
-
256
- <javaClientGenerator
257
- targetPackage="${xml.mapperPackage}"
258
- targetProject="${xml.javaProject}"
259
- type="XMLMAPPER" >
260
-
261
- </javaClientGenerator>
262
- <!-- set table info -->
263
- <table tableName="m_phone_log" domainObjectName="PhoneLog1" mapperName="{0}Dao"
264
- enableCountByExample="false" enableUpdateByExample="false"
265
- enableDeleteByExample="false" enableSelectByExample="false" modelType="flat">
266
- <property name="useActualColumnNames" value="false" />
267
- <generatedKey column="" sqlStatement="MySql" identity="true"/>
268
- <!--<generatedKey column="ID"-->
269
- <!--sqlStatement="SELECT LAST_INSERT_ID()" />-->
270
- </table>
271
- </context>
272
-
273
- </generatorConfiguration>
274
- ```
275
- Set the variable in the table information.
276
-
206
+ 1 . Add [ generatorConfig.xml] ( generatorConfig.xml ) to your execution module.Set the variable in the table information.
277
207
2 . In the build.gradle file append [ Specify settings] ( #set-mbg-settings )
278
208
3 . In the build.gradle directory execute ``` gradle mbg ```
279
209
4 . The default support for mysql.If you use oracle or other database need to add the following additional configuration to [ Specify settings] ( #set-mbg-settings ) .
0 commit comments