Search code examples
javaconfigmybatis-generator

how to set domainObjectName suffix in generateConfig.xml for mybatis generator


I encountered this situation:

table : t_user,t_manager,...

domainObjectName : UserEntity,ManagerEntity,...

I know how to replace the prefix using the domainObjectRenamingRule,

but how can i append the suffix?


Solution

  • You can use a regular expression capture group for this. For example:

    <domainObjectRenamingRule searchString="^(?i)t(.*)" replaceString="$1Entity" />