It took a day to fix Springboot + Mybatis
I have written the strategic logic for several months, which is a bit silly. To do database and table splitting, it took almost a day to use the simplest Mybatis in spring boot. The ability to solve macro problems has declined a lot after a long time in logic details.
To use Mybatis in spring boot, you need to do the following steps:
1. use S ...
Posted by shmeeg on Mon, 20 Jan 2020 04:58:40 -0800
Use of idea 5 -- create project 2
1. Create WEB project
The community version does not have the function of creating a web project, so it can only create a maven web project. Here, the enterprise version of cracking is used.
1.1 creation steps
File-New-Project
In the pop-up window, select Java Enterprise - project SDK - Java EE ...
Posted by le007 on Sat, 18 Jan 2020 08:10:39 -0800
Fragment upload and breakpoint continue
We may encounter the upload of large files in our work. If we transfer them once, we may encounter various problems such as network and timeout. Here, we will introduce the scheme in two ways: fragment upload and breakpoint continue transfer.
1, Slice upload
Principle of fragment upload: the front end f ...
Posted by joey3002 on Sat, 18 Jan 2020 06:46:06 -0800
Spring boot upload and echo pictures
I met this problem last time when I was working on a personal blog project. Now let's write down the solution steps
IDE: IDEA
Language: java
Framework: spring boot
Template engine: thymeleaf
1, See the effect1. Picture submission2. Picture display2, Design process
1.pom.xml
<dependency>
<g ...
Posted by mailjol on Sat, 18 Jan 2020 05:19:44 -0800
Log4j2 configuration and customization
The new requirements need to make some customized things on log4j, so the log4j2 is supplemented
To configure
Let's look at the traditional configuration of log4j2
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<properties>
<property name="log_path"> ...
Posted by fluteflute on Fri, 17 Jan 2020 03:18:16 -0800
Data source and connection pool of Mybatis principle
In Java engineering projects, we often use the Mybatis framework to add, delete, query and modify the data in the database. Its principle is to encapsulate JDBC and optimize the connection of data sources.
Let's review the process of JDBC operating database.
JDBC operation database
When JDBC operates the database, you need to specify the co ...
Posted by The End on Thu, 16 Jan 2020 23:08:18 -0800
mybatis plug-in development
We start from six aspects: plug-in configuration, plug-in writing, plug-in operation principle, plug-in registration and interception time, initialization plug-in, paging plug-in principle.
1. Plug in configuration
Mybatis plug-ins are configured in the configuration. During initialization, these plug ...
Posted by Frame on Mon, 13 Jan 2020 02:54:49 -0800
Spring Boot+mybatis create multi data source connection
Spring Boot+mybatis create multi data source connection
1, Background: the company system needs to do heterogeneous database data migration, need to configure multiple data sources, there are also some small problems in the configuration process, so make a record here;
2, Code address:
3, Code exp ...
Posted by rookie on Sat, 11 Jan 2020 08:10:12 -0800
23 design modes: factory method mode
According to the different levels of abstraction, factory pattern can be divided into three types: simple factory pattern (also known as static factory pattern), factory method pattern described in this paper, and abstract factory pattern.
Advantages of factory mode:
It can make the code structure cle ...
Posted by mojodojo on Fri, 10 Jan 2020 21:31:45 -0800
[Mybatis Source Exploration]--- Interpretation of the Core Source of Mybatis Query Procedure--- mapper Call Method
Article Directory
1 Source Entry
Interpretation of core source code of 2 sqlSession.getMapper(...) method
2.1 What should be analyzed without looking at the source code
2.2 [Source Code Analysis] Get the MapperProxyFactory object corresponding to TUserMapper
2.3 [Source Code Analysis] Use dynamic pr ...
Posted by cpetercarter on Fri, 10 Jan 2020 17:37:17 -0800