public class

RenameExampleClassPlugin

extends PluginAdapter
java.lang.Object
   ↳ org.mybatis.generator.api.PluginAdapter
     ↳ org.mybatis.generator.plugins.RenameExampleClassPlugin

Class Overview

This plugin demonstrates overriding the initialized() method to rename the generated example classes. Instead of xxxExample, the classes will be named xxxCriteria This plugin accepts two properties:

  • searchString (required) the regular expression of the name search.
  • replaceString (required) the replacement String.
For example, to change the name of the generated Example classes from xxxExample to xxxCriteria, specify the following:
searchString
Example$
replaceString
Criteria

Summary

[Expand]
Inherited Fields
From class org.mybatis.generator.api.PluginAdapter
Public Constructors
RenameExampleClassPlugin()
Public Methods
void initialized(IntrospectedTable introspectedTable)
This method is called just before the getGeneratedXXXFiles methods are called on the introspected table.
boolean validate(List<String> warnings)
[Expand]
Inherited Methods
From class org.mybatis.generator.api.PluginAdapter
From class java.lang.Object
From interface org.mybatis.generator.api.Plugin

Public Constructors

public RenameExampleClassPlugin ()

Public Methods

public void initialized (IntrospectedTable introspectedTable)

This method is called just before the getGeneratedXXXFiles methods are called on the introspected table. Plugins can implement this method to override any of the default attributes, or change the results of database introspection, before any code generation activities occur. Attributes are listed as static Strings with the prefix ATTR_ in IntrospectedTable.

A good example of overriding an attribute would be the case where a user wanted to change the name of one of the generated classes, change the target package, or change the name of the generated SQL map file.

Warning: Anything that is listed as an attribute should not be changed by one of the other plugin methods. For example, if you want to change the name of a generated example class, you should not simply change the Type in the modelExampleClassGenerated() method. If you do, the change will not be reflected in other generated artifacts.

public boolean validate (List<String> warnings)