Java uses ThreadFactory to create new threads

First, build a thread encapsulation class, WorkThread, which is mainly used to manage threads better. public class WorkThread extends Thread {       private Runnable target;   //Thread execution target     private AtomicInteger counter;         public WorkThread(Runnable target, AtomicInteger co ...

Posted on Wed, 16 Oct 2019 12:29:10 -0700 by virken

Learning of mybatis

(this case is listed under maven project:) 1. Establishment of experimental environment: (a student table, a teacher table) CREATE TABLE `teacher` ( `id` INT(10) NOT NULL, `name` VARCHAR(30) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=INNODB DEFAULT CHARSET=utf8 INSERT INTO teacher(`id`, `name`) VALUES (1, 'Teacher Qin'); CR ...

Posted on Wed, 16 Oct 2019 11:11:58 -0700 by brighton

Mybatis -- input mapping in mapper.xml

6. Input mapping The type of input parameter is specified by parameterType, which can be simple type, hashmap, POJO packing type. 6.1 packaging object of POJO 6.1.1 demand To complete the comprehensive query of user information, the query conditions that need to be passed in are very complex (may include user information, other information, ...

Posted on Wed, 16 Oct 2019 10:27:58 -0700 by gentusmaximus

Dynamic SQL statement in mybatis

Sometimes, static SQL statements do not meet the needs of the application. We can build SQL statements dynamically according to some conditions. For example, in a Web application, there may be some search interfaces that require you to enter one or more options and then perform a search operation based on these selected criteria. We may need t ...

Posted on Tue, 15 Oct 2019 19:55:10 -0700 by Darkpower

A simple way to use tk.mybatis

A pom.xml import dependency (an error will be reported in the lower version here) <dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</artifactId> <version>2.1.5</version> </dependency> ...

Posted on Tue, 15 Oct 2019 13:39:16 -0700 by ponies3387

Mybatis Source Analysis: Environment Settings

Mybatis Environment Configuration Class Environment When initializing the Mybatis framework, we need to configure the environment element, which allows multiple elements, so that we can switch back-end storage in different environments. If you have an id attribute for the environment, the id must be unique. Otherwise, the subsequent configurat ...

Posted on Mon, 14 Oct 2019 08:48:17 -0700 by Nabster

Java Dynamic Proxy Source Analysis

Java Dynamic Proxy Source Analysis Interface and proxy classes Interface package cn.jastz.java.reflect.dynamic.proxy; /** * @author zhiwen */ public interface Foo { void bar(); void rtest(); void rtest1(); void rtest2(); } proxy class // // Source code recreated from a .class file by IntelliJ IDEA // (powered by Fernflower d ...

Posted on Sun, 13 Oct 2019 09:42:37 -0700 by DigitalNinja

Springboot+MyBatis+JPA Integration

1. Preface Springboot has been very popular recently, and I have also tasted the sweetness of the project. I have been using Springboot+JPA for a long time, and found that JPA is not too flexible, or maybe I am not proficient in JPA. In sum, in order to learn more about Springboot, I decided to try the integration of Springboot+MyBatis+JPA. ...

Posted on Sat, 12 Oct 2019 12:29:49 -0700 by ScubaDvr2

Spring Framework Learning Notes - SSM Integration and Maven Custom Template Creation

Spring+Spring MVC+MyBatis+Maven The core of SSM integration is Spring+MyBatis integration. Looking back on MyBatis operation database process, we use a SQL Session Factory object to get the SQL Session, and then CRUD operation. Now, with spring, we load and manage the SQL Session Factory through spring. If you want to use it directly, please go ...

Posted on Fri, 11 Oct 2019 22:44:20 -0700 by NArc0t1c

Start-up Analysis of MyBatis

Preface MyBatis is one of the most commonly used persistence layer frameworks at present. By analyzing its source code, we can make better use of it in our use process. This series is based on mybatis-3.4.6 for analysis.MyBatis's initial work is to parse the main configuration file, map the configuration file, and annotate information. It is t ...

Posted on Thu, 10 Oct 2019 23:15:15 -0700 by outatime88