栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringBoot使用Mybatis-Generator配置过程详解

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringBoot使用Mybatis-Generator配置过程详解

:> 使用Spring initialier 需要配置文件

POM文件


复制代码 代码如下: org.springframework.boot spring-boot-starter-web org.mybatis.spring.boot mybatis-spring-boot-starter 2.1.1 org.springframework.boot spring-boot-devtools runtime true mysql mysql-connector-java runtime org.springframework.boot spring-boot-starter-test test org.junit.vintage junit-vintage-engine org.mybatis.generator mybatis-generator-maven-plugin 1.3.2 mybatis-generator deploy generate src/main/resources/mybatis-generator/generatorConfig.xml true true mysql mysql-connector-java 8.0.19 org.mybatis.generator mybatis-generator-core 1.3.2a org.springframework.boot spring-boot-maven-plugin exec 1: application配置文件

复制代码 代码如下:## mapper xml 文件地址mybatis.mapper-locations=classpath*:mapper/*Mapper.xml##数据库urlspring.datasource.url=jdbc:mysql://localhost/test2?userSSL=true&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT##数据库用户名spring.datasource.username=root##数据库密码spring.datasource.password=root##数据库驱动spring.datasource.driver-class-name=com.mysql.jdbc.Driver#Mybatis Generator configuration#dao类和实体类的位置mybatis.project =src/main/java#mapper文件的位置mybatis.resources=src/main/resources配置 Mybatis-Generator复制代码 代码如下:

3: 进行配置

右侧Maven处点击如图所示位置


测试陈宫

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/135026.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号