current position:Home>Mybatis framework - Introduction to mybatis

Mybatis framework - Introduction to mybatis

2022-01-27 01:09:36 Onion love code

Mybatis frame -----Mybatis brief introduction


One 、 What is? Mybatis And the role

1. Mybatis Is an excellent persistence layer framework
2. Support customization SQL、 Stored procedures and high-level mappings
3. Almost all of them were avoided JDBC Code and manually set the parameters and get the result set
4. Easy to use XML Or annotation configuration mapping native information , Will interface of Java Of POJOs(Plain Ordinary Java Object , ordinary Java object ) Maps to records in the database


Two 、Mybatis And Hibernate Comparison

Serial number Mybatis Hibernate
1 Mybatis It's a semi-automatic ORM The framework requires handwritten code , Can be more precisely defined SQL sentence , More flexible , It's also easier to optimize performance Hibernate It's a fully automatic ORM frame , establish Java Complete mapping between objects and database tables , Encapsulates the SQL sentence , The operator can operate the database completely with the idea of surface phenomenon object ,Hibernate Generate SQL sentence , Although you can control the generation through the mapping configuration file SQL The sentence doesn't need to be handwritten SQL Statements, but produce complex SQL Statements are difficult to implement , Even if implemented, performance will be lost
2 Big workload 、 High flexibility 、 High optimization Low workload 、 Low flexibility 、 Low optimizability
3 For high concurrency 、 Fast response Internet projects Traditional projects
4  Insert picture description here  Insert picture description here
5 The time cost of learning is low The time cost of learning is high

copyright notice
author[Onion love code],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270109336358.html

Random recommended