First, Introduction
MyBatis, similar to hibernate, is a simplified framework for database operations, but unlike Hibernate, MyBatis is more flexible and the overall framework is smaller, which is reflected in the need for our handwritten SQL statements, Hibernate, however, will be completely transparent to the programmer for the operation of the database, and the programmer only needs to write the code according to the object-oriented thought, and to look at the SQL statement, it must be declared in the configuration file.
<name= "Show_sql">true</Property>
Hibernate has a very thorough encapsulation of the database operations, so the flexibility is not high, MyBatis can implement hibernate-like features, but the need to write their own SQL statements, it does not mean that the use of mybatis more cumbersome, on the contrary, personally think the MyBatis framework is small , the configuration is also very simple, mybatis really good place where, why it will become more and more fire?
MyBatis's official Mybatics 3.1.1 Document explains why MyBatis is getting more and more hot:
This is probably because the full set of features provided by MyBatis can be implemented using XML based on the "Mapping Language", which is why MyBatis has been popular for so many years.
The above content is related to the "Mapping file" in MyBatis, which is not difficult to see in this passage. The core of MyBatis is the "map file", which enables all functions of the mybatis. Its form is as shown above.
Second, the basic use method of MyBatis
"Java EE Learning Day 79th" "MyBatis Basic Use Method" "MyBatis and Spring Integration"