SpringBoot当中如何整合mybatis和注入

[学习笔记]

6.整合mybatis和注入:

马克[email protected]马克java社区: 根据第3部分的helloworld例子,用那个项目做底子。pom.xml只需要加入mybatis和mysql的部分,另外注意版本要比helloworld的高,比如要1.5.9版本以上。 参见我的项目bootMybatis1。

SpringBoot当中如何整合mybatis和注入

pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com</groupId>
    <artifactId>springboot</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>
    <build />
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
    </parent>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>     

更多请见:http://www.mark-to-win.com/index.html?content=Frame/frameUrl.html&chapter=Frame/springBoot_web.html#mybatis