springBoot JPA代码生成器
介绍
通过IDEA+配置文件,根据数据库表结构快速生产Service、ServiceImpl、repository、repositoryImpl、自动生成常用的jpa增删改查等方法。
使用的版本
Spring Boot2.1.6.RELEASE + spring-boot-starter-data-jpa
使用idea 生成代码步骤
打开idea
(https://images.gitee.com/uploads/images/2019/0718/005133_b8179731_2166801.jpeg "1.jpg") 2.
(https://images.gitee.com/uploads/images/2019/0718/005551_6b796c25_2166801.png "2.png") 3.
(https://images.gitee.com/uploads/images/2019/0718/005620_dc332e3f_2166801.png "3.png") 4.
(https://images.gitee.com/uploads/images/2019/0718/005633_793db240_2166801.jpeg "4.jpg")
配置文件内容替换我的: Generate POJOs.groovy
5.完成以上操作,保存配置文件之后。
(https://images.gitee.com/uploads/images/2019/0718/005945_1e6f1163_2166801.png "5.png")
此时会让你选择要生成的保存目录。
6.生产的文件与包名
(https://images.gitee.com/uploads/images/2019/0718/010235_076b7603_2166801.png "6.png")
7.所生产出来的java文件。我都上传,大家可以去看看
(https://images.gitee.com/uploads/images/2019/0718/010451_3a596311_2166801.png "7.png")
(https://images.gitee.com/uploads/images/2019/0718/010458_abbae530_2166801.png "8.png")
先前参考简书上的帖子,后经自己改良的配置生成。
大佬的帖子: Spring Boot JPA idea代码自动生成 其二 https://www.jianshu.com/p/523af440eaf6
原文地址:
https://gitee.com/xietingsheng/springbootjpadaimachengqi/#https://images.gitee.com/uploads/images/2019/0718/005633_793db240_2166801.jpeg