The <plugin> Element

The <plugin> element is used to define a plugin. Plugins can be used to extend or modify the code generated by MyBatis Generator (MBG). This element is a child element of the <context> element. Any number of plugins may be specified in a context. The plugins will be called in the order that are listed in the configuration.

For more information about implementing plugins, see the Implementing Plugins reference page.

For more information about plugins supplied with MyBatis Generator, see the Supplied Plugins reference page.

Required Attributes

Attribute Description
type The fully qualified name of the class that implements the plugin. The class must implement the interface org.mybatis.generator.api.Plugin, and must have a public default constructor. Note that it is far easier to extend the adapter class org.mybatis.generator.api.PluginAdapter than to implement the entire interface.

Optional Attributes

None

Child Elements