赞
踩
代码自动生成:AutoGenerator 是 MyBatis-Plus 的代码生成器,通过 AutoGenerator 可以快速生成 Entity、Mapper、Mapper XML、Service、Controller 等各个模块的代码,极大的提升了开发效率。
通过一下步骤演示如何使用AutoGenerator:
1.我们需要在数据库新建一个表
- CREATE TABLE user
- (
- id BIGINT(20) NOT NULL COMMENT '主键ID',
- name VARCHAR(30) NULL DEFAULT NULL COMMENT '姓名',
- age INT(11) NULL DEFAULT NULL COMMENT '年龄',
- PRIMARY KEY (id)
- }
2.新建一个springboot项目,导入相关依赖
- <dependency>
- <groupId>com.baomidou</groupId>
- <artifactId>mybatis-plus-generator</artifactId>
- <version>3.5.3</version>
- </dependency>
-
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mys
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。