Skip to content

yookue/mybatis-provider-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mybatis Provider Spring Boot Starter

Spring Boot application integrates mybatis quickly, to support different statements of different databases.

Quickstart

  • Import dependencies
    <dependency>
        <groupId>com.yookue.springstarter</groupId>
        <artifactId>mybatis-provider-spring-boot-starter</artifactId>
        <version>LATEST</version>
    </dependency>

By default, this starter will auto take effect, you can turn it off by spring.mybatis-provider.enabled = false

  • Configure Spring Boot application.yml with prefix spring.mybatis-provider (Optional)
spring:
    mybatis-provider:
        configFile: 'classpath:/META-INF/mybatis/database-id-provider.xml'

This will create a DatabaseIdProvider bean, which supports most popular relational databases in the world.

  • Write your mybatis mapper statements as following:
<select id="foo" resultType="bar" databaseId="mysql">
</select>

Note that the databaseId segment, that is the database identifier from your configFile node of the previous step.

Document

Requirement

  • jdk 17+

License

This project is under the Apache License 2.0

See the NOTICE.txt file for required notices and attributions.

Donation

You like this package? Then donate to Yookue to support the development.

Website

Releases

No releases published

Packages

No packages published

Languages