Sometimes in a project, there are situations where you need to connect two databases. This article will talk about how to use dual data sources (or multiple data sources) in combination with Spring and Mybatis.
The key to implementing multiple data sources in this article is the AbstractRoutingDataSource provided by Spri ...
Posted on Thu, 04 Jun 2020 11:09:39 -0700 by smallflower
1, What is reverse engineering?
2, Characteristics of MyBatis reverse engineering
1. Advantages of MyBatis reverse engineering
2. Disadvantages of MyBatis reverse engineering
3, MyBatis reverse engineering construction
1. Add dependency pom.xml
2. Create MBG profile generatorConfig.xml
Posted on Thu, 04 Jun 2020 06:45:24 -0700 by millsy007
The resultMap element is the most important and powerful element in MyBatis.It frees you from 90% of JDBC ResultSets data extraction code and allows you to perform operations that JDBC does not support in some cases.In fact, when writing mapping code for complex statements such as connections, a resultMap can replace thousands of l ...
Posted on Sat, 23 May 2020 17:54:21 -0700 by Julian Pedley
Download Mybatis source code and import it into IDE tool
Download the source code of Mybatis
Open the browser and enter the web address https://github.com/mybatis/mybatis-3 You can access Mybatis' warehouse in Github.
So far, the latest version of mybatis is 3.5.3-SNAPSHOT, but because the version I used in my previous learning process is 3.5 ...
Posted on Wed, 20 May 2020 23:18:46 -0700 by ninib
Introduction to Spring Cloud
Introduction to microservices
Reasons for Spring Cloud:
Advantages and disadvantages of microservices:
Spring Cloud version problems
Corresponding relationship with Spring Boot version
---Split line - premise of learning - split line---
Basic project constructi ...
Posted on Thu, 14 May 2020 08:21:46 -0700 by misteryoji
Mybatis generator can help us automatically generate a lot of structured code, such as Entity, Mapper interface and Xml file corresponding to each table, which can save a lot of tedious work.
1. Add plug-in dependency in pom file:
<!-- mybatis generator Auto generate code plug-in -->
Posted on Mon, 11 May 2020 09:40:55 -0700 by robinjohn
When writing mysql statement with mybatis, we encountered the problem of 1-to-many relationship
First look at the relationship:
Based on table A, A record in table A corresponds to A record in table B, while A record in table A corresponds to n records in table C. then table B and table C are 1-to-1. The query statement at this time is:
Posted on Mon, 04 May 2020 08:17:15 -0700 by kneifelspy
Every time po and mapper are generated before, the Example class and its corresponding CURD method are generated. It's also troublesome to delete, so just let it not be generated.
The specific configuration is very simple. You only need to turn off the generated method in the table tag of the table to be set. The code is as follows.
Posted on Fri, 01 May 2020 06:36:12 -0700 by micmania1
I wrote an article about MyBatis Click the link to enter the basic CRUD of low version comparison
However, it is not necessary to write dao layer and entity layer code in actual development, mainly using the shelf package provided by MyBatis
Here is the whole process of using reverse engineering
2, Demo and code
① Create a ja ...
Posted on Fri, 01 May 2020 00:14:19 -0700 by geetakhurana
Spring boot is a service development framework that integrates service publishing, database management and log management. It is also an all-around helper for microservice development. This chapter describes how to use spring boot to access MySQL database.
2, Build basic environment
1. Install Maven (a lot of guidance docume ...
Posted on Thu, 30 Apr 2020 20:09:29 -0700 by johnh