"Java EE Learning Day 79th" "MyBatis Basic Use Method" "MyBatis and Spring Integration"

Source: Internet
Author: User

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"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.