Package org.mybatis.generator.config
Class DomainObjectRenamingRule
java.lang.Object
org.mybatis.generator.config.DomainObjectRenamingRule
This class is used to specify a renaming rule for table's domain object name.
If domainObjectName is not configured, we'll build the domain object named
based on the tableName or runtimeTableName. And then we use the domain object
renaming rule to generate the final domain object name.
For example, if some tables are named:
- SYS_USER
- SYS_ROLE
- SYS_FUNCTIONS
it might be annoying to have the generated domain name all containing the SYS prefix. This class can be used to remove the prefix by specifying
- searchString="^Sys"
- replaceString=""
Note that internally, the generator uses the
java.util.regex.Matcher.replaceAll method for this function. See
the documentation of that method for example of the regular expression
language used in Java.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetReplaceString(String replaceString) voidsetSearchString(String searchString) void
-
Field Details
-
searchString
-
replaceString
-
-
Constructor Details
-
DomainObjectRenamingRule
public DomainObjectRenamingRule()
-
-
Method Details
-
getReplaceString
-
setReplaceString
-
getSearchString
-
setSearchString
-
validate
-