1. Lazy loading in Mybatis (XML file configuration)
1. Lazy loading and immediate loading
Lazy loading
Lazy loading (2)
Second, the cache in Mybatis
什么是缓存
为什么使用缓存
什么样的数据能够使用缓存,什么样的数据不能使用
Mybatis中的一级缓存和二级缓存
一级缓存:缓存的是对象
二级缓存:缓存的是数据而不是对象
1. Use the secondary cache
2. Under the main configuration file
Through the cache, when the id of the two queries is the same as the first, the cache is read the second time,
and the data is taken out, which improves the efficiency of reading. The final output is still false