I go! The mybatis notes written by Alibaba's pure hands are now available to me. They are simply tailor-made!

Speaking of MyBatis, let me first ask: What is MyBatis?

MyBatis is an excellent persistence layer framework that supports customized SQL, stored procedures, and advanced mapping. MyBatis avoids almost all JDBC code and manual setting of parameters and obtaining result sets. MyBatis can use simple XML or annotations for configuration and native Maps, and map interfaces and Java POJOs (Plain Old Java Objects, ordinary Java objects) into records in the database...

Today, what we are going to talk about is the Alibaba Collector's Edition mybatis handwritten document . The friends who got it are really fragrant and warn!

Disclaimer: The space is limited. The Alibaba Collector’s Edition mybatis handwritten documents also have some interview analysis + brain maps, etc., which are not very careful, but you can share the source documents with friends who have read this article, and you can privately write my password [document] , Quickly collect and brush up!

Collector's Edition (1)-Introduction to Mybatis

1. What is MyBatis

2. Why do we use Mybatis?

3. Mybatis quick start

  • 3.1 Import the development package

  • 3.2 Preparation for testing

  • 3.3 create mybatis configuration file

  • 3.4 Write a tool class to test whether the connection is obtained

  • 3.5 Create entity and mapping relationship file

  • 3.6 Writing DAO

4. Mybatis workflow

5. Complete the CRUD operation

  • 5.1 Increase students

  • 5.2 Query data based on ID

  • 5.3 Query all data

  • 5.4 Delete based on id

  • 5.5 Modification

  • 5.6 Small details

  • 5.7 Mybatis pagination

6. Dynamic SQL

  • 6.1 Dynamic query

  • 6.2 Dynamic update

  • 6.3 Dynamic deletion

  • 6.4 Dynamic Insertion

7. Getting started summary

Collector's Edition (2)-Mybatis configuration information

1. Mapping file

  • 1.1 Placeholder

  • 1.2 Primary key generation strategy

  • 1.2.1 UUID

  • 1.3 Primary key return

  • 1.4 resultMap

  • 1.5 difference between resultMap and resultType

  • 1.6 Use resultMap

  • 1.7 Summary of resultType and resultMap usage

  • 1.8 Mybatis mapping file handles special characters

2. Configuration file

  • 2.1 Aliases

  • 2.2 Mapper loading

  • 2.3 Lazy loading

  • 2.4 Lazy loading test

3. Configuration related summary

Collector's Edition (3)-Association Mapping

1. Mybatis [multi-table connection]

1.1-to-one

  • 1.1.1 Design table

  • 1.1.2 Entity

  • 1.1.3 Mapping file

  • 1.1.4 DAO layers

1.2-to many

  • 1.2.1 Design database tables

  • 1.2.2 Entity

  • 1.2.3 Mapping file SQL statement

  • 1.2.4 DAO

1.3 Many to Many

  • 1.3.1 Database Table

  • 1.3.2 Entity

  • 1.3.3 Mapping file

  • 1.3.4 DAO

2. Summary of Association Mapping

Collector's Edition (4)-Caching + Mapper Agent + Reverse Engineering

1 Introduction

2.Mybatis cache

  • 2.1 Mybatis—level cache

  • 2.2 Mybatis secondary cache

  • 2.3 Mybatis secondary cache configuration

  • 2.4 Pojo serialization of query result mapping

  • 2.5 Disable the second level cache

  • 2.6 refresh cache

  • 2.7 Understanding of military Mybatis cache-some parameters

3. Mybatis and ehcache cache framework integration

  • 3.1 Integrate the jar package

  • 3.2 ehcache.xml configuration information

  • 3.3 Application scenarios and limitations

  • 3.3.1 Application scenarios

  • 3.3.2 Limitations

4.Mapper proxy mode

  • 4.1 Mapper Development Specification

  • 4.2 Mapper proxy return value problem

5. Mybatis solves the problem of JDBC programming

6.Mybatis reverse engineering

  • 6.1 Modify pom.xml file

  • 6.2 generatorConfig.xml configuration file

  • 6.3 Steps to use plug-ins

  • 6.4 Final code generation

Collector's Edition (5)-Mybatis integrates Spring

1. Mybatis and Spring integration

  • 1.1 Import jar package

  • 1.2 Create a table

  • 1.3 Create entity

  • 1.4 Create a mapping file between entities and tables

  • 1.5 Create Mybatis mapping file configuration environment

  • 1.6 Configure Spring core filter [also load the total configuration file]

  • 1.7 Configure database information and transactions

  • 1.8 Create Dao, Service, Action

  • 1.9 JSP page test

2. Summary

Teach you how to integrate and develop the MyBatis-Spring project-"Introduction to MBati technical principles and actual combat"

"Introduction to MBati Technical Principles and Actual Combat" is divided into three parts:

The first part is the basic application of MyBatis, which mainly introduces how to use MyBatis efficiently.

  • Section 1: Introduction to the content of MyBatis, tell readers what MyBatis is and in which scenarios to use it.

  • Section 2: Mainly introduce the basic modules of MyBatis and its life cycle, and give examples.

  • Section 3: Mainly introduce the main meaning and content of MyBatis configuration.

  • Section 4: Introduce the main elements of MyBatis Mapper and how to use them.

  • Section 5: Introduction to dynamic SQL, to help you easily deal with most SQL scenarios.

The second part is the principle of MyBatis. We will go deep into the source code to understand the internal operation principle of MyBatis and the development methods and skills of plug-ins.

  • Section 6: Introduce the analysis and operation principle of MyBatis, we will understand the construction method of SqlSession and how its four major objects work.

  • Section 7: On the basis of Section 6, we will focus on the introduction of MyBatis plug-ins. Here we will learn the design principles of plug-ins, as well as development methods and points of attention.

The third part is the actual combat application of MyBatis, which mainly explains some practical scenarios of MyBatis.

  • Section 8: Introduction to MyBatis-Spring, mainly explains how to integrate MyBatis applications in Spring projects, to help readers use MyBatis smoothly in the Spring environment.

  • Section 9: Introduce the practical scenarios of MyBatis, and select a batch of typical and commonly used scenarios. Detailed analysis of each scenario, developers need to pay attention to avoid some errors and performance losses.

Also: a small MyBatis source code analysis book-"MyBatis Source Code Analysis"

Second: For MyBatis interviews-some of the most common questions have been sorted and analyzed

  • 1. Why do you need pre-compilation?

  • 2. What Executor executors does Mybatis have? What is the difference between them?

  • 3. How to specify which type of Executor to use in Mybatis?

  • 4. Does Mybatis support delayed loading? If so, what is its implementation principle?

  • 5. The difference between # {} and ${}?

  • 6. How to write like sentence in fuzzy query?

  • 7. How to pass multiple parameters in mapper?

  • 8. How does Mybatis perform batch operations?

  • 9. How to get the generated primary key?

  • 10. What to do when the attribute name in the entity class is different from the field name in the table

  • 11. How many ways are there to write Mapper?

  • 12. What is the interface binding of MyBatis? What are the ways to achieve it?

  • 13. What are the requirements when using the mapper interface of MyBatis to call?

  • 14. In best practice, usually an Xml mapping file will have a Dao interface corresponding to it. What is the working principle of this Dao interface? When the method in Dao interface has different parameters, can the method be overloaded?

  • 15. In the Xml mapping file of Mybatis, can the id be repeated for different Xml mapping files?

  • 16. Briefly describe the mapping relationship between Mybatis's Xml mapping file and Mybatis internal data structure?

  • 17. How does Mybatis encapsulate the sql execution result as a target object and return it? What are the mapping forms?

  • 18. All tags in MyBatis?

  • 19. There are several ways to realize one-to-one and one-to-many in MyBatis, how to operate?

  • 20. Can Mybatis map Enum enumeration class?

  • 21. What does Mybatis dynamic sql do? What are the dynamic SQL? Can you briefly describe the implementation principle of dynamic sql?

  • 22. Paging method?

  • 23. Briefly describe the operation principle of Mybatis plug-in, and how to write a plug-in?

  • 24. What is the primary and secondary cache of Mybatis?

  • 25. The principle of pageHelper?

Regarding the analysis, I have all sorted out and hand-drawn a xmind map, as follows (at a glance):

Finally: learning summary-MyBtis knowledge brain map (pure hand-drawn xmind document)

After learning, if you want to check the effect, the best way is to summarize it yourself. For example, after I finish learning a thing, I will draw a brain map of the knowledge combing outline of the xmind file by myself. This will also facilitate the follow-up review, and it is all my own understanding. I believe that just a few glances can quickly complete the whole picture. Knowledge, brain make up. The following is my hand-drawn MyBtis knowledge brain map. Since it is an xmind file, it is not easy to upload, so the editor will export it as a picture and upload it here. The details are not particularly clear. But you can provide the complete original MyBtis knowledge brain map to interested friends (including the interview analysis xmind document above )

——You can directly send a private message to my password [document] and reply immediately to share and download (100% free download!)

In addition, the previously mentioned Alibaba Collector's Edition mybatis handwritten document as well as a small MyBatis source code analysis document - "MyBatis source code analysis," and so on documents related study notes, also Jieke share recognized a friend!

- thanks to support recognition of the big guys , Free Download Note: Forward + + private letter forwarded my password [documentation] can be! ! !

Guess you like

Origin blog.csdn.net/GYHYCX/article/details/109063067