mybatis-generator secondary development summary

Secondary development (as this article only record the specific code and articles, including the network, copy it out)

Customizing the generated code requirements:

1. The method of removing an interface is generated by default example:

(1) Configuration generatorConfig.xml

(2) modify the source code tableConfiguration.java

Note 2. The default model class removal / mapper mapping file generated and Interfaces

(1) modify the configuration file, add <plugin>

(2) modify the source code DefaultCommentGenerator.java

3. Modify the generated class name:

(1) modify the source code introspectedTable.java (such generated code controlling the entire basic configuration and basic parameters)

(2) calculateJavaClientAttributes () control interface class suffix

4. Custom method name, parameters name, etc. Import

introspectedTable.java, call the set method assignment

Source Package structure:

api package: the program entry / global parameters, etc.

dom.java: entity class contains basic control parameter generated code, such as a method, param, etc.

mybatis3.javamapper: generating a control interface class

mybatis3.model: generating a control model class

mybatis3.xmlmapper: generating a control mapper

Guess you like

Origin www.cnblogs.com/zuzZ/p/9679625.html