目录
MyBatisCodeHelperPro的安装(IDEA插件的两种安装方式)
6、在mapper中增加方法,并通过Alt+Enter快速生成对应的sql语句
MyBatisCodeHelperPro是一个可以帮助我们使用Mybaits时通过entity实体类快速生成对应的数据库表和mapper以及mapper.xml的插件
MyBatisCodeHelperPro的安装(IDEA插件的两种安装方式)
第一种(在plugins中直接安装):打开IDEA,在File--->Setting--->Plugins中搜索MyBatisCodeHelper-Pro插件直接安装,完成后重启IDE即可
第二种(通过本地Install到IDE中安装):其实插件可以简单理解为一个jar包,先下载好插件jar包,然后打开File--->Setting--->Plugins插件安装设置,点击设置,选择Install Plugin from Disk...
打开插件选择界面,找到下载好的插件jar包选中点击ok即可将插件安装到IDE中,完成后重启IDE
通过IDEA连接MySQL数据库,方便后续的数据库操作
使用test数据库做演示,当前test数据库下有四张表
MyBatisCodeHelperPro的使用
1、新建项目工程测试
2、在pom文件中引入依赖(后面测试需要用到)
<dependencies>
<!--单元测试依赖-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!--lombok依赖-->
<dependency>
<groupId>org.projectlombok</groupId>