Spingboot自动生成生成实体类、映射XML和Dao

首先,咱们先创建一个新的springboot项目,

Spingboot自动生成生成实体类、映射XML和Dao_第1张图片

在Web选项中勾选Web,在Template Engines选项中勾选 Thymeleaf,在SQL选项中勾选MySQL和MyBatis。然后一直下一步到完成,项目结构为:

Spingboot自动生成生成实体类、映射XML和Dao_第2张图片

pom.xml文件如下:


  1. PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"

  2. "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">

  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9. enableCountByExample="true"

  10. enableUpdateByExample="true"

  11. enableDeleteByExample="true"

  12. enableSelectByExample="true"

  13. selectByExampleQueryId="true">

生成实体类,dao,xml映射 :

Spingboot自动生成生成实体类、映射XML和Dao_第3张图片

然后 你会看到让你大吃一斤的结果,真香!!!

你可能感兴趣的:(java爱好者,springboot)