SpringBoot2.x series of tutorials (fifty-four) SpringBoot2.x integrated combat Mybatis

Many mainstream market ORM framework, and even Asia was undoubtedly the most Mybatis use in domestic, foreign and more using JPA. This article will take you to learn how to integrate Spring Boot Mybatis.

This article first to integrate Mybatis XML version, for example. What is XML version? It is the corresponding SQL statement written in * mapper.xml file, rather than the realization in the form of annotations.

Mybatis Profile

MyBatis is an excellent persistence framework that supports custom SQL, stored procedures and advanced mappings. MyBatis eliminates almost all of the JDBC code and setting parameters and get the result set to work. MyBatis can be configured and primitive types, interfaces and Java POJO (Plain Old Java Objects, plain old Java object) is recorded in the database mapped by a simple XML or annotation.

Dependent on the introduction of

Speaking Mybatis rely on integration, we have introduced from pom.xml complete pom dependencies are as follows:

<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.2.RELEASE</version

Guess you like

Origin blog.csdn.net/wo541075754/article/details/105157004