HashMap's 7 traversal methods and performance analysis!

In general, HashMap traversal can be divided into the following four categories: Iterator mode traversal;For Each traversal;Lambda expression traversal (JDK 1.8+);Streams API traversal (JDK 1.8+). However, each type has different implementation methods, so the specific traversal methods can be divided into the following 7 types: 1. Use Itera ...

Posted by bookbuyer2000 on Mon, 19 Sep 2022 21:21:02 +0300

Mybatis Series Textbook - Basic - many to one

Step 1: run first, see the effect, and then learn Step 2: imitation and troubleshooting Step 3: many to one relationship Step 4: see the effect before learning Step 5: modify product java Step 6: product xml Step 7: mybatis config xml Step 8: Test mybatis Step 9: runnable projects Step 10: Exercise - modify the many to one relationship ...

Posted by M. Abdel-Ghani on Tue, 24 May 2022 13:15:21 +0300

Tear spring and spring MVC parent-child containers by hand

1, Background Spring and spring MVC have a parent-child container relationship, and it is precisely because of this that the problem of package scanning often occurs. Here we analyze and understand the parent-child container relationship between spring and spring MVC, and give the official recommended method of package scanning in spring and sp ...

Posted by piyushsharmajec on Tue, 24 May 2022 03:28:59 +0300

Mybatis Series Textbook - related concepts - delayed loading

Step 1: run first, see the effect, and then learn Step 2: imitation and troubleshooting Step 3: one to many based on annotation Step 4: add log Step 5: only query the classification without obtaining products Step 6: add the configuration of delayed loading Step 7: only query the classification without obtaining products Step 8: you can ...

Posted by agriz on Mon, 23 May 2022 16:49:16 +0300

Dynamic sql tags commonly used by mybatis

explain When we write some sql queries, it is very troublesome and error prone to splice sql according to conditions. The dynamic sql tag of mybatis can solve this annoying problem. The dynamic sql tags commonly used by mybatis are as follows: label effect if Single conditional branch, equivalent to judgment statement choose,when,othe ...

Posted by ysu on Mon, 23 May 2022 14:49:21 +0300

MyBatis: Cache for MyBatis

1. MyBatis first level cache The first-level cache is at the SqlSession level. The data queried through the same SqlSession will be cached. The next time the same data is queried, it will be obtained directly from the cache and will not be re-accessed from the database.Four situations that invalidate the L1 cache: Different SqlSession s ...

Posted by vh3r on Sat, 21 May 2022 22:14:55 +0300

MyBatis Junior Actual 2: Additions, Deletions, and Reviews

Welcome to my GitHub https://github.com/zq2599/blog_demos Content: A summary of all original articles, including Java, Docker, Kubernetes, DevOPS, etc. This is the second article in the MyBatis Beginner Actual Warfare series. We know how to integrate MyBatis in SpringBoot from the previous article. We will practice basic skills together: adding ...

Posted by Ekate on Sat, 21 May 2022 20:05:01 +0300

MyBatis study notes - 07 many to one and many to one

I Many to one 1. Description Multiple students correspond to one teacher For students, it is related to... Multiple students and one teacher [many to one] For teachers, a collection, a teacher, has many students [one to many] 2. Cases 1. Data sheet preparation Student table CREATE TABLE `student` ( `id` int(10) NOT NULL, `name` varchar( ...

Posted by stevebrett on Sat, 21 May 2022 17:26:13 +0300

What is the difference between [Mybatis series] #{} and ${}?

When we write mybatis in the development process, most people may use #{}, but we also have another symbol ${}. What is the difference between them? When applying variables, we use #{} by default, as follows: <select id=getUserById resultType="org.hyf.mybatis.model.User"> select * from user where id = #{id}; </select> &lt ...

Posted by brown2005 on Fri, 20 May 2022 16:15:58 +0300

Introduction to Mybatis CRUD

preface As a senior back-end coder, he has to deal with the database every day. Hibernate, a highly encapsulated persistence framework, was first used. Since I came into contact with Mybatis, I have been impressed by its flexibility. I can write SQL myself. Although it is lightweight, although the sparrow is small, it has all kinds of internal ...

Posted by Maq on Thu, 19 May 2022 06:14:33 +0300