一、MyBatis Generator 簡介
官網(wǎng)的MyBatis Generator使用介紹,請點擊下面的鏈接:
鏈接
MyBatis Generator 生成的文件包含三類:
(1)Model實體文件,一個數(shù)據(jù)庫表對應(yīng)生成一個 Model 實體;
(2)Mapper接口文件,數(shù)據(jù)數(shù)操作方法都在此接口中定義;
(3)Mapper?XML配置文件
二、使用步驟
1.引入MyBatis Generator相關(guān)依賴
在pom.xml文件添加如下依賴:
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.7</version>
</dependency>
2.配置generatorConfig.xml文件
文章來源:http://www.zghlxwxcb.cn/news/detail-623408.html
代碼如下(示例):文章來源地址http://www.zghlxwxcb.cn/news/detail-623408.html
<?xml version="1.0" encoding
到了這里,關(guān)于mybatis-generator代碼生成器的使用與配置的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!