SpringBoot使用Mybatis-Generator配置过程详解
:>使用Springinitialier需要配置文件
POM文件
1:application配置文件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.2 aorg.springframework.boot spring-boot-maven-plugin exec
##mapperxml文件地址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#MybatisGeneratorconfiguration#dao类和实体类的位置mybatis.project=src/main/java#mapper文件的位置mybatis.resources=src/main/resources配置Mybatis-Generator
3:进行配置
右侧Maven处点击如图所示位置
测试陈宫
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。
热门推荐
10 小红书平安祝福语简短
11 生日祝福语大全女孩简短
12 收生日红包祝福语 简短
13 领证幽默祝福语简短
14 法考面试祝福语简短
15 老哥出门祝福语简短语
16 送灯祝福语简短独特
17 幼儿狗年祝福语大全简短
18 好听的元旦简短祝福语