SpringBoot笔记(三)通用mapper

mybatis的官网(https://github.com/mybatis/spring-boot-starter)提供了对springboot的支持。

1、pom三坐标

<dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>1.3.2</version>
</dependency>

2、properties中配置mybatis中扫描的实体类别名和mapper映射文件位置

# mybatis 别名扫描
mybatis.type-aliases-package=cn.jun.pojo
# mapper.xml文件位置,如果没有映射文件,请注释掉
mybatis.mapper-locations=classpath:mappers/*.xml

猜你喜欢

转载自blog.csdn.net/u013089490/article/details/83585072