Briefly describe the architecture of MyBatis and the architecture of mybatis.

Source: Internet
Author: User

Briefly describe the architecture of MyBatis and the architecture of mybatis.

The architecture of MyBatis consists of the following key components;

1. load configuration

There are two types of configuration: xml configuration file, the other is the java code annotation MyBatis which loads the SQL configuration information into MappedStatement objects (including input parameter ing configuration, execution of SQL statements, and result ing configuration ), and store it in memory.

2. SQL Parsing

When the API interface layer receives a request, it receives the ID and object of the input SQL statement (Map, javabean, or basic data type can be used ), myBatis will find the corresponding MappedStatement Based on the SQL id, and then parse the MappedStatement based on the input parameter object. After parsing, the final SQL statement and parameters to be executed can be obtained.

3. SQL Execution

Obtain the final SQL statements and parameters to the database for execution and obtain the database operation results.

4. Result ing

Convert the result of the Operation database according to the ing configuration. You can convert the result to HashMap, JavaBean, or based on the data type, and return the final result.

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.