The <ibatorPlugin> element is used to define a plugin. Plugins can be used to extend or modify the code generated by Ibator. This element is a child element of the <ibatorContext> 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 plugins, see the Implementing Ibator Plugins reference page.
Ibator supplies several plugins (all are in the package
org.apache.ibatis.ibator.plugins
). The supplied plugins demonstrate
different types of tasks that can be accomplished with Ibator plugins. Source
code for the plugins is available with the Ibator downloads, or can be viewed
online
here.
Plugin | Description |
---|---|
(package).EqualsHashCodePlugin |
This plugin adds equals and hashCode methods to the
Java model objects generated by Ibator.
The The |
(package).RenameExampleClassPlugin |
This plugin demonstrates usage of the initialized method
by renaming the generated example classes generated by Ibator.
This plugin accepts two properties:
For example, to rename the generated example classes from xxxExample to xxxCriteria, specify Example$ for searchString and Criteria for replaceString |
(package).SerializablePlugin |
This plugin adds the marker interface java.io.Serializable to the
Java model objects generated by Ibator. This plugin also adds the
serialVersionUID field to the model classes.
Important: This is a simplistic implementation of java.io.Serializable and does not attempt to do any versioning of classes. |
(package).SqlMapConfigPlugin |
This plugin generates a skeleton SqlMapConfig.xml file that contains
references to the SqlMap.xml files generated by Ibator.
This plugin accepts three properties:
Note: |
Attribute | Description |
---|---|
type | The fully qualified name of the class that implements the plugin.
The class must implement the interface
org.apache.ibatis.ibator.api.IbatorPlugin ,
and must have a public default constructor. Note that it is far
easier to extend the adapter class
org.apache.ibatis.ibator.api.IbatorPluginAdapter
than to implement the entire interface. |
None