[MyBatis Source Analysis] Load the Xml configuration file
Debug Entry
Find the XmlConfigBuilder Test in the mybatis source code and run shouldSuccessfully Load XMLConfigFile () in debug mode.
Initialization
First, create the XMLConfigBuilder object, in the construction method:
Reading files through InputStream to generate Document objects for XML, the operations related to XML are beyond the sc ...
Posted by Imad on Wed, 05 Jun 2019 12:06:24 -0700
mybatis Details (9) - - Level 1 Cache and Level 2 Cache
In the last chapter, we explained how to improve query efficiency by lazy loading of mybatis. What other methods can improve query efficiency besides lazy loading? This is the cache we talked about in this chapter.
mybatis provides us with a first-level cache and a second-level cache, which can be understood by the following figure:
Fir ...
Posted by steve55 on Tue, 04 Jun 2019 15:04:04 -0700
Mybatis Source Parsing-Interface Scanning
In mybatis-spring, there's a comment called MapperScan, and we'll start with him today. When we add this comment, it represents the introduction of Bean s of the MapperScanner Registrar class.
public class MapperScannerRegistrar implements ImportBeanDefinitionRegistrar, ResourceLoaderAware {}
He's an example of ImportBean Definition Registrar ...
Posted by FireDrake on Sat, 25 May 2019 13:57:21 -0700
In-depth introduction to Mybatis series 4-configuration details of the type Aliases alias (mybatis source)
Note: This article is reproduced from Nan Ke Meng
In the previous article, "Deep and Simple Mybatis Series (3) - Configuration Detailed Properties and Environments" (Mybatis Source Chapter), we introduced properties and environments. This article continues to talk about one of the remaining configuration nodes: type Aliases. The typeA ...
Posted by jumphopper on Fri, 24 May 2019 14:27:37 -0700
Mybatis Principle--Caching Mechanism (Level 1 Caching)
MyBatis designed a two-level structure for data caching, which is divided into a first-level cache and a second-level cache:A first-level cache is a Session session-level cache: among SqlSession objects that represent a database session, also known as a local cache.Level 1 caching is a feature implemented internally by MyBatis that users cannot ...
Posted by plasko on Tue, 21 May 2019 10:50:23 -0700
Mybatis Framework Learning (2) mybatis.cfg.xml Configuration Notes
Click Open Link
I used Idea's IDE environment. To create xml more easily and quickly using mybatis framework, I created templates in my IDE environment.
Specific template creation can be viewed by clicking on the following link: ----> to be added later
Under the resource folder, create the configuration xml file - > mybatis. cfg. xml
Co ...
Posted by serg91 on Sun, 19 May 2019 20:46:15 -0700
MyBatis Environment Configuration and Introduction
Mybatis development environment, select: Eclipse, MySQL 5.5, JDK 1.8, mybatis 3.2.3.jar package. These software tools can be downloaded from their official websites.
The whole process is summarized as follows.
In this tutorial, build java Engineering, but generally is the development of web projects, this series of tutorials ...
Posted by andco on Thu, 16 May 2019 06:19:19 -0700
Minimalist Mybatis Tour (1): CRUD
abstract
Recently, mybatis framework has been studied. As an excellent ORM framework, many excellent design ideas of mybatis are worth learning.
The configuration files of mybatis are mainly config and mapper. Config defines global parameters: data source type (POOL, UNPOOLED, JNDI), transaction management type (default manag ...
Posted by UVL on Thu, 16 May 2019 01:23:03 -0700
MyBatis Level 2 Cache
Secondary Cache
This tag needs to be added to the mapping file
<cache/>
The select statement in the mapping statement will be cached, and the insert update delete statement in the mapping statement will refresh the cacheCache recycling using LRU algorithmNow the complete configuration file is as follows
<?xml version="1.0" encoding ...
Posted by schris403 on Wed, 15 May 2019 16:48:36 -0700
easymybatis-mybatis development tool
easymybatis is a mybatis enhanced class library, which aims to simplify the development of mybatis and make it more efficient.
git address: easymybatis
demo address: demo with springboot
easymybatis has the following characteristics:
The CRUD operation can be completed without writing xml files.
Support multi-table query, aggregate query a ...
Posted by wowiz on Tue, 14 May 2019 10:26:29 -0700