MyBatis Mapper integration with Spring Boot

Mapper-Spring-Boot-Starter 帮助你集成通用 Mapper 到 Spring Boot。

Mapper-Spring-Boot-Starter will help you use Mapper with Spring Boot.

本项目已经包含在 https://github.com/abel533/Mapper

https://github.com/abel533/Mapper/tree/master/spring-boot-starter

自 2.0.0 版本起,这个项目不在进行维护,后期还会删除该项目。

How to use

在 pom.xml 中添加如下依赖:

Add the following dependency to your pom.xml:

<dependency>
    <groupId>tk.mybatis</groupId>
    <artifactId>mapper-spring-boot-starter</artifactId>
    <version>1.2.4</version>
</dependency>

1.2.4 - 2018-03-06

1.2.3 - 2018-01-24

1.2.2

1.2.1 - 2018-01-10

1.2.0 - 2018-01-08

1.1.7 - 2017-12-17

1.1.6 - 2017-11-11

1.1.5 - 2017-10-21

1.1.4 - 2017-08-18

1.1.3 - 2017-07-18

1.1.2 - 2017-07-17

1.1.1 - 2017-03-28

1.1.0 - 2017-02-19

Example

https://github.com/abel533/MyBatis-Spring-Boot

Special Configurations

一般情况下,你不需要做任何配置。

Normally, you don't need to do any configuration.

如果需要配置,可以使用如下方式进行配置:

You can config PageHelper as the following:

application.properties:

mapper.propertyName=propertyValue

示例:

mapper.mappers[0]=tk.mybatis.sample.mapper.BaseMapper
mapper.mappers[1]=tk.mybatis.mapper.common.Mapper

默认情况下,没有 mappers 配置时,会自动注册 tk.mybatis.mapper.common.Mapper

因为通用 Mapper 是固定的属性,所以接收参数使用的对象,按照 Spring Boot 配置规则,大写字母都变了带横线的小写字母。针对如 IDENTITY(对应i-d-e-n-t-i-t-y)提供了全小写的 identity 配置,如果 IDE 能自动提示,看自动提示即可。

IDE 应该可以自动提示:

自动提示属性

MyBatis Mapper

https://github.com/abel533/Mapper