mybatis自动生成时如何设置不生成Example类详解
时间:2021-02-15 10:21:02|栏目:JAVA代码|点击: 次
本文主要给大家介绍了关于mybatis自动生成时不生成Example类的相关内容,分享出来供大家参考学习,下面来看看详细的介绍:
只需要在配置要生成的table表中添加几个配置属性就行了。
在generatorConfig.xml文件中修改
<!--指定数据库表--> <table tableName="t_user" schema="" > <generatedKey column="userId" sqlStatement="Mysql" identity="true"/> </table> <table tableName="t_scene" schema="" > <generatedKey column="sceneId" sqlStatement="Mysql" identity="true"/> </table>
修改如下:
<!--指定数据库表--> <table tableName="t_user" schema="" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" > <generatedKey column="userId" sqlStatement="Mysql" identity="true"/> </table> <table tableName="t_scene" schema="" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" > <generatedKey column="sceneId" sqlStatement="Mysql" identity="true"/> </table>
好了,先把之前自动生成的文件删除,重新执行一个generate命令,就可以看见比较清爽的代码内容了~
总结
上一篇:Java方法反射实现原理详解
栏 目:JAVA代码
本文标题:mybatis自动生成时如何设置不生成Example类详解
本文地址:http://www.codeinn.net/misctech/63326.html


阅读排行
- 1Java Swing组件BoxLayout布局用法示例
- 2java中-jar 与nohup的对比
- 3Java邮件发送程序(可以同时发给多个地址、可以带附件)
- 4Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.Type异常
- 5Java中自定义异常详解及实例代码
- 6深入理解Java中的克隆
- 7java读取excel文件的两种方法
- 8解析SpringSecurity+JWT认证流程实现
- 9spring boot里增加表单验证hibernate-validator并在freemarker模板里显示错误信息(推荐)
- 10深入解析java虚拟机




