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>

  

 

 

转自:http://blog.csdn.net/u012679583/article/details/53371034

 

posted on 2017-06-22 14:38  Snowman-Nunu  阅读(1194)  评论(0编辑  收藏  举报

导航