What is? MyBatis

MyBatis It was apache An open source project of iBatis, 2010 This project was established in apache software foundation Moved to google
code, And changed its name to MyBatis. Is based on Java Persistence layer framework of

Why do we use Mybatis?

Whether it is Mybatis,Hibernate It's all ORM An implementation framework of , It's all right JDBC A package of !

up to now , We've learned several techniques in the persistence layer ……

* Hibernate
* jdbc
* SpringDAO
Then why do we have to learn Mybatis What about ??? Now? Mybatis Popular in the industry , Why is it so hot ??

Hibernate It's an old framework , All the students who have used it know that , As long as you can use it , Very comfortable to use …… what sql No code …… But , It also has some disadvantages :
When dealing with complex business , Poor flexibility , complex HQL Hard to write, hard to understand , For example, the HQL sentence

and JDBC It's easy to understand , Just a few fixed steps , It's just that it's too much trouble to develop , Because we have to do everything ourselves .

We can think that ,Mybatis namely jdbc and Hibernate A balance point between …… After all, this framework is now used in the industry , We can't stop learning !

 

As a result of 101 page , Too much content to show all , Need full version of private message “ file ” Free access , Now I will put the picture in silence ;

Mybatis configuration information

 

Association mapping

 

cache +Mapper agent + reverse engineering

This article mainly explains Mybatis The following knowledge points of :

Mybatis Cache level 1 cache level 2 cache and Ehcache integration Mapper Proxy usage Mapper Agents don't need to write implementation classes. Reverse engineering generates code automatically

 

Mybatis integration Spring

 

Mybatis Common interview questions

1. #(} and ${) What's the difference ?

2. When the property name in the entity class and the field name in the table are not - equally . What should I do? ?

3. How to get auto generated ( main ) Emergy ?

4. stay mapper How to transfer multiple parameters in ?

5. Mybatis dynamic sq| What is it for ? What are the trends sq|? Can briefly describe - Next dynamic sq Does not ?

6. Mybatis Of Xml In the mapping file , different Xm Drop file ,id yes No can be repeated ?

7. Why Mybati It's semi-automatic ORM Mapping tools ? What's the difference between it and fully automatic ?

8. usually - individual Xml Mapping files , Can write - individual Dao Interface corresponding to , Excuse me? , this Dao How the interface works ? Dao Method in interface , Different parameters , Can methods be overloaded ?

9. Mybatis than iBatis What are the major improvements

10. There are several ways to implement the interface binding ?

11. Mybatis How to page ? What is the principle of paging plug-ins ?

12. sketch Mybatis The operation principle of broadcast , And how to write - Plug ins

13. Mybatis Whether delay loading is supported ? If supported , What is its implementation principle ? .

14. Mybatis What do you have Executor Actuator ? What is the difference between them ? .

15. MyBatis And Hibernate What are the differences ?

Technology
©2019-2020 Toolsou All rights reserved,
It's unexpected Python Cherry tree (turtle The gorgeous style of Library )html Writing about cherry trees , Writing about cherry trees java Four functional interfaces ( a key , simple ) Browser kernel ( understand )06【 Interpretation according to the frame 】 Data range filtering -- awesome HashMap Explain in detail os Simple use of module computer network --- Basic concepts of computer network ( agreement , system ) Some East 14 Pay change 16 salary , Sincerity or routine ?