java.lang.Object |
↳ |
org.mybatis.generator.config.ColumnRenamingRule |
Class Overview
This class is used to specify a renaming rule for columns in a table. This
renaming rule will be run against all column names before calculating the
corresponding property name. The most common use case is when columns in a
table are all prefixed by a certain value.
For example, if columns in a table are named:
- CUST_NAME
- CUST_ADDRESS
- CUST_CITY
- CUST_STATE
it might be annoying to have the generated properties all containing the CUST
prefix. This class can be used to remove the prefix by specifying
- searchString = "^CUST"
- 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.
Summary
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0)
|
final
void
|
wait(long arg0, int arg1)
|
|
Public Constructors
public
ColumnRenamingRule
()
Public Methods
public
String
getReplaceString
()
public
String
getSearchString
()
public
void
setReplaceString
(String replaceString)
public
void
setSearchString
(String searchString)
public
void
validate
(List<String> errors, String tableName)