# vst-codeing
**Repository Path**: tobeytang/vst-codeing
## Basic Information
- **Project Name**: vst-codeing
- **Description**: hibernate代码生成插件项目
- **Primary Language**: Java
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2022-04-15
- **Last Updated**: 2023-05-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
### vst代码生成
1. 依赖片段如下:
```
org.springframework.boot
spring-boot-starter-web
org.hibernate
hibernate-core
5.2.18.Final
org.springframework.boot
spring-boot-starter-jdbc
org.apache.commons
commons-lang3
3.4
commons-collections
commons-collections
3.2.2
mysql
mysql-connector-java
8.0.28
cn.hutool
hutool-all
5.3.9
```
2. **项目配置**
bootstrap.yml配置说明,此处数据源用于连接数据库,获取数据表信息,以供代码生成
```
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/visitor
username: root
password: root
```

3. **安装生成插件**
- idea-> file-> Settings-> Plugins-> Browser repositories... 搜索“Hibernate Code Generator” 安装。
4. **生成代码**
- idea-> Code-> Code Generator 填写相关信息


5. **最终效果**
- 生成代码如下

5. **生成表字段说明**
- 示例表
```
CREATE TABLE `sys_label` (
`id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`label_name` varchar(20) DEFAULT NULL COMMENT '标签名称',
`create_user_id` int(11) NOT NULL COMMENT '创建用户id',
`update_user_id` int(11) NOT NULL COMMENT '修改用户id',
`tenant_id` int(11) NOT NULL COMMENT '租户id',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`status` int(11) NOT NULL DEFAULT '0' COMMENT '状态:0--正常 1--删除',
PRIMARY KEY (`id`) USING BTREE
) COMMENT='标签表';
```
- 字段id、create_user_id、update_user_id、create_time、update_time、status、tenant_id代码增删改会自动维护