mybatis逆向工程

1.逆向工程git地址

  https://github.com/HaniLucky/example/tree/master/generatorSqlmapCustom

  修改数据库地址即可

2.可选配置:生成文件时只生成实体类,接口,映射文件和基本的增删改查.(修改生成表的配置)

1  <!-- 指定数据库表,要生成哪些表,就写哪些表,要和数据库中对应,不能写错! -->
2         <table tableName="user" 
         <!-- 下面这些配置是不生成Example 如果需要生成不需要配置-->
3 enableCountByExample="false" 4 enableUpdateByExample="false" 5 enableDeleteByExample="false" 6 enableSelectByExample="false" 7 selectByExampleQueryId="false"> 8 </table>

3.(生成的增删改查)基本的增删改查

  /**
  *  带Selective和不带Selective的区别
  *  带Selective是选择性差值和更新,不带是必须赋值

  */
  int deleteByPrimaryKey(String id); int insert(IdxSplit record); int insertSelective(IdxSplit record); IdxSplit selectByPrimaryKey(String id); int updateByPrimaryKeySelective(IdxSplit record); int updateByPrimaryKey(IdxSplit record);
原文地址:https://www.cnblogs.com/covet/p/10106689.html