• SpringBoot集成Mybatis


    1.Myabtis

    <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>2.0.0.RELEASE</version>
    </parent>
    
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
      </dependency>
    
      <dependency>
        <groupId>org.mybatis.spring.boot</groupId>
        <artifactId>mybatis-spring-boot-starter</artifactId>
        <version>1.1.1</version>
      </dependency>
    
      <!-- mysql 依赖 -->
      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
      </dependency>
    </dependencies>
    
    <build>
      <plugins>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
      </plugins>
    </build>

    2.配置文件

    spring.datasource.url=jdbc:mysql://localhost:3306/test20
    spring.datasource.username=root
    spring.datasource.password=admin
    spring.datasource.driver-class-name=com.mysql.jdbc.Driver
    mybatis.type-aliases-package=com.majiaxueyuan.mapper
    mybatis.mapper-locations=classpath:mapping/*.xml

    .

  • 相关阅读:
    while循环和递归
    ASP.NET Core Swagger 显示接口注释
    ABP依赖注入
    EF Core 笔记
    .NET Core 管道过滤器扩展
    ABP权限认证
    552 you must authentication
    C# 多线程写文件,时常写不成功
    .Net 的一些插件
    多线程下HttpContext.Current 的问题
  • 原文地址:https://www.cnblogs.com/crazycode2/p/10363452.html
Copyright © 2020-2023  润新知