mybatis逆向工程去除表前缀和字段前缀的配置


 

 

 首先导入依赖

<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.6</version>
</dependency>
重点来了
配置文件
<table schema="" tableName="sys_account">
<generatedKey column="sys_id" sqlStatement="Mysql" />
<domainObjectRenamingRule searchString="^Sys" replaceString="" />
<columnRenamingRule searchString="^[^_]+" replaceString=""/>
</table>

如果是匹配所有表
<table schema="" tableName="sys%">
<generatedKey column="sys_id" sqlStatement="Mysql" />
<domainObjectRenamingRule searchString="^Sys" replaceString="" />
<columnRenamingRule searchString="^[^_]+" replaceString=""/>
</table>



免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM