Writing in the front

I definitely prefer Mybatis to Hibernate, just because I think it really works, haha. It is easy to learn and master; Separate SQL statement and code, convenient unified management and optimization; Of course, there are disadvantages: SQL is a lot of work, especially many fields, associated tables, more so. And SQL depends on the database, resulting in poor database portability.

It’s best to understand the pros and cons of a framework before you choose one that works best for your project and is the most efficient.

Introduction of mybatis

MyBatis is an excellent persistence layer framework that supports ordinary SQL queries, stored procedures, and advanced mapping. MyBatis eliminates almost all manual setting of JDBC code and parameters and retrieval of result sets. MyBatis uses simple XML or annotations for configuration and raw mapping to map interfaces and Java’s POJOs (Plain Old Java Objects) to records in the database.

Go straight to the mind map





1. Mybatis introduction. PNG





2. Compare with Hibernate. PNG





3. Several key classes.png





4, Mybatis execution analysis. PNG





5. Overall design of MyBatis framework. PNG





6. Mybatis initialization and execution of SQL procedures. PNG





7, mybatis source code several main components. PNG





8. XML mapping configuration file (I).png





9. XML mapping configuration file (ii).png





XML mapping configuration file (3).png

Write in the last

This article only writes the principle of Mybatis and the basic utility of the configuration file, and the next one will write the usage method of Mybatis. Welcome to pay attention to my public account Java-MindMap, more Java mind maps for you to learn, and I will update this article every three to four days, bringing you into the world of memory brain maps.