Mybatis source code series execution process

1. Use of mybatis public static void main(String[] args) throws IOException { //1.Get profile stream InputStream is = Resources.getResourceAsStream("mybatis-config.xml"); //2.structure SqlSessionFactory SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(is); //3.establish SqlSession SqlSession sq ...

Added by jingato on Sat, 01 Jan 2022 03:13:58 +0200

Stop writing loops! mybatis inserts data in batches and updates the collection list in batches. Isn't it fragrant?

Firstly, the mybatis framework encapsulates sql statements and executes them through tag and attribute parsing in the form of xml. We know that the sql statements inserted into the table are: INSERT INTO table name (column 1, column 2,...) VALUES (value 1, value 2,...) During the insertion process, the database will add transactions by d ...

Added by webtailor on Thu, 30 Dec 2021 14:31:58 +0200

Mybatis deferred loading policy

1 delayed loading concept Delayed loading: Data is loaded only when it is needed. Data is not loaded when it is not needed. Lazy loading is also called lazy loading. Benefits: query from a single table first, and then associate the query from the associated table when necessary, which greatly improves the database performance, because querying ...

Added by sheen4him on Thu, 30 Dec 2021 12:24:06 +0200

Exercise on spring integrating mytabis spring configuration file replaces mybatis core file

spring integrates mytabis Is to use the function of mybatis in the spring architecture It is equal to the mybatis tar package imported from the code written in non spring architecture to do the operation of the core configuration file, mapping configuration file and dynamic proxy interface of mybatis. Then there are operations such as dao, se ...

Added by zak on Wed, 29 Dec 2021 14:57:32 +0200

Mybatis plus - learning notes

reference resources: MyBatis-Plus 1, Quick start 1.0 preparation reference resources MyBatis-Plus Create table statement in! 1.1 add dependency & profile During springboot consolidation: <!-- springboot Unit test dependencies for --> <dependency> <groupId>org.springframework.boot</groupId> ...

Added by velkymx on Tue, 28 Dec 2021 23:24:26 +0200

Mybatis study notes

MyBatis 1, Framework introduction 1.1 concept of framework Framework is a semi-finished product of software, which completes the general operation in the process of software development. Programmers can realize specific functions with little or no processing, so as to simplify the development process and improve efficiency. 1.2 common ...

Added by burntheblobs on Tue, 28 Dec 2021 19:57:53 +0200

day12_ Complex query

1, Construction of complex query environment ​ mybatis-config.xml file configuration <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <settings> <!--<setting name=" ...

Added by Oldiesmann on Tue, 28 Dec 2021 04:12:47 +0200

Use mybatis in spring boot and test it

1. pom.xmlDetailed POM XML file reference blogger source codeWhere h2's scope can be test.2. Spring boot uses mybatis for database operationWhen using mybatis, you need org mybatis. spring. boot:mybatis-spring-boot-starter:2.1. 3 [compile] dependency.Then create an interface and use the @ Mapper tag. mybatis will search for this tag and parse t ...

Added by sri2002 on Mon, 27 Dec 2021 14:05:50 +0200

SpringBoot: multi data source configuration based on MyBatis

preface Previously, in the process of using SpringBoot to build background services, we usually access a database and a data source The MQTT service used in the new project needs authentication, but the MQTT service is used by multiple projects, so its authentication database is in a separate database. At this time, we need to configure ...

Added by Dillenger on Mon, 27 Dec 2021 12:20:53 +0200

Mybatis connection pool and transaction control

1 Mybatis connection pool In Mybatis's sqlmapconfig XML configuration file to configure the connection pool in Mybatis Generally, POOLED data source is used The data source configuration is in sqlmapconfig In the XML file, the specific configuration is as follows: <!-- Configure data source (connection pool) information --> <dataSo ...

Added by FloridaNutz on Mon, 27 Dec 2021 12:20:22 +0200