自动生成实体类、Mapper、Mapper.xml文件
搭建Spring Boot + Mysql + MyBatis 项目
核心
配置pom.xml
创建表
配置文件
生成文件
结果
项目结构
搭建Spring Boot + Mysql + MyBatis 项目
idea 可直接创建相应的项目及配置
核心
配置pom.xml
mysql
mysql-connector-java
5.1.38
org.springframework.boot
spring-boot-starter
org.springframework.boot
spring-boot-starter-test
test
com.example
common
0.0.1-SNAPSHOT
org.mybatis.spring.boot
mybatis-spring-boot-starter
1.1.1
com.alibaba
druid
1.0.26
org.mybatis.generator
mybatis-generator-maven-plugin
1.3.5
创建表
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号',