使用mybatis如何设置禁止生成Example类
今天就跟大家聊聊有关使用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>
看完上述内容,你们对使用mybatis如何设置禁止生成Example类有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注行业资讯频道,感谢大家的支持。