当前位置:网站首页>Reverse generation of crud code using Renren generator
Reverse generation of crud code using Renren generator
2022-07-21 02:52:00 【Program ape who does not understand development】
Use renren-generator Reverse generation CRUD Code
- Environment and Version Description
- Go to gitee Open source everyone project renren-generator project
- 1、 stay gulimall-common Introduction in renren-generator module
- 2、 modify `generator.properties` Medium `moduleName` and `tablePrefix`
- 3、 modify `application.yml` The name of the database connected in
- 4、 start-up renren-generator project
- 5、 Select the table , Generate entity class code directly
- 6、 In the generated code main The folder is directly copied in the corresponding project src/main Next
Environment and Version Description
Tools | edition |
---|---|
JDK | 1.8.0_301 |
MySQL | 5.7.36 |
IDEA | 2021.3.3 |
Maven | 3.8.5 |
SpringBoot | 2.7.1 |
SpringCloud | 2021.0.3 |
MyBatis-Plus | 3.2.0 |
Docker | 20.10.17 |
Go to gitee Open source everyone project renren-generator project
https://gitee.com/renrenio/renren-generatorgit clone https://gitee.com/renrenio/renren-generator
Delete the inside .git
Folder in your project , The areas that need to be modified are :
1、 stay gulimall-common Introduction in renren-generator module
2、 modify generator.properties
Medium moduleName
and tablePrefix
3、 modify application.yml
The name of the database connected in
4、 start-up renren-generator project
Visit the target page :http://localhost/#main.html
5、 Select the table , Generate entity class code directly
6、 In the generated code main The folder is directly copied in the corresponding project src/main Next
Other order modules , Membership module , The warehouse modules are modeled like this in turn .
stay Test Written in the module CRUD operation , Check whether the database access is normal
package com.atguigu.gulimall.product;
import com.atguigu.gulimall.product.entity.BrandEntity;
import com.atguigu.gulimall.product.service.BrandService;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.List;
@SpringBootTest
class GulimallProductApplicationTests {
@Autowired
BrandService brandService;
@Test
void contextLoads() {
// BrandEntity brandEntity = new BrandEntity();
// brandEntity.setBrandId(1L);
// brandEntity.setName(" Apple ");
// brandEntity.setDescript("Apple");
// brandEntity.setName(" Huawei ");
// brandService.save(brandEntity);
// System.out.println(" Saved successfully ");
// brandService.updateById(brandEntity);
List<BrandEntity> list = brandService.list(new QueryWrapper<BrandEntity>().eq("brand_id", 1L));
list.forEach((item)->{
System.out.println(item);
});
}
}
【 pit 1】
In the last gulimall-ware An error is reported in the module : Unable to load main class
error : Cannot find or load main class com.atguigu.gulimall.ware.GulimallWareApplication
resolvent :maven ===> clean ===> compile
【 pit 2】
Report errors : Can't find factorybean, Injection failed , yes lombok=1.18.4 Version of is too low , Mismatch . It is suggested to change to the following version
<lombok.version>1.18.14</lombok.version>
边栏推荐
- 织梦添加栏目修改栏目时提示“保存目录数据时失败,请检查你的输入资料是否存在问题”
- 买量洞察与渠道评估,助力营销决策优化
- 【FAQ】接入HMS Core推送服务,服务端下发消息常见错误码原因分析及解决方法
- 虚拟主机代理商需要注意什么?
- What is the registration process of website domain name?
- How to configure access control in Gerrit system
- About Variables
- A detailed explanation of the implementation principle of go Distributed Link Tracking
- Date get the name of the working day from the object
- Technical dry goods | average surface distance of image segmentation based on mindspire
猜你喜欢
[Android Development iOS Series] Language: SWIFT vs kotlin
Swift used smamb2 package, and the sad process of repacking
Technical dry goods | solve 80% of the problems in the interview, and realize auc/roc based on mindspire
Word文档怎么删除页眉页脚和横线
Structure completion (flexible array)
织梦DEDE后台系统用户管理显示空白的解决方法
From concept to security practice: a basic guide to software supply chain
Developers must read: 2022 mobile application operation growth insight white paper
Interpreting the implementation principle of go Distributed Link Tracking
虚实相生,构建数智生活|HMS Core. Sparkle应用创新分论坛报名启动
随机推荐
硅谷课堂笔记(上)
Structure completion (flexible array)
[Android development IOS series] Language: swift vs kotlin
Detailed explanation of getchar () function in C language
Jenkins自动化部署
A detailed explanation of the implementation principle of go Distributed Link Tracking
AI2 (APP inventor 2) offline version
Metauniverse 3D wilderness
【FAQ】接入HMS Core推送服务,服务端下发消息常见错误码原因分析及解决方法
Fiddler5+ lightning simulator 4.0 settings for app packet capturing
Jenkins Automated Deployment
Introduction, installation and basic use of mongodb database
Technical dry goods | average surface distance of image segmentation based on mindspire
Developers share the second regression analysis of "Book Eating bar: deep learning and mindspire practice"
解决OpenCV读取视频结束后报错的问题
Solution to the blank display of user management in Zhimeng Dede background system
Developers must read: 2022 mobile application operation growth insight white paper
Software interface and simple system simulation
Buying insight and channel evaluation help optimize marketing decisions
织梦DEDE后台系统用户管理显示空白的解决方法