Stop writing tool classes by yourself, Spring Boot has all the built-in tool classes you need! !

Assertion An assertion is a logical judgment that checks for something that shouldn’t happen The Assert keyword was introduced in JDK1.4 and can be turned on through the JVM parameter -enableassertions SpringBoot provides the Assert assertion tool class, which is usually used for data validity checking. //Requires parameter object to be non-null (Not Null), otherwise […]

mybatis handles one-to-many, many-to-one, many-to-many relationships, annotations and xml file writing

Zero, Preface This article is used to study one-to-many, many-to-one, and many-to-many relationships between tables and objects. Two methods of xml file configuration and annotation configuration were studied Super complete~ The entities used for research are students, teachers, courses Note: The relationship between students and teachers should be many-to-many. This article uses many-to-one, that is, […]

[Array method reduce] Details of reduce and simulation rewriting of other array extension methods

Learn key phrases: Array.reduce Array.prototype.reduce reduce method Override reduce method 1. Write in front Many students (referring to myself) have no difficulty in learning other array expansion methods, but when it comes to the reduce method, they will appear stupid, so today I will quickly explain this method clearly. In fact, all array expansion methods […]

The Tao of Git Commit: Standardized Commit Message Writing Guide

1 commit message specification The commit message format includes three parts: Header, Body and Footer <type>(<scope>): <subject> <body> <footer> Header is required, Body and Footer can be omitted. 1.1 Header Type (required) type is used to describe the category of git commit, and the following identifiers are allowed. feat:New function (Feature) “Feat” is used to […]

[SpringBoot] Handwriting simulates the core process of SpringBoot

Dependency package Create a new project containing two modules: springboot module, representing springboot source code implementation;The user module represents the business system and uses the springboot module; Dependency packages: Spring, SpringMVC, Tomcat, etc., introduce dependencies as follows: <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.3.18</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>5.3.18</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.3.18</version> </dependency> <dependency> <groupId>javax.servlet</groupId> […]

Java tool class for reading and writing excel supports multiple Sheets

1. What is POI POI’s full name is PoorObfuscation Implementation. It is an open source project of Apache components that can read and write a series of Microsoft Office office software. The POI version corresponding to the examples in this article is 3.9. 2. Generate Excel tool class package org.zhao.component; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import […]

Use the Function interface in Java 8 to eliminate if…else (a very novel way of writing)

Article directory Function functional interface Supplier supply function Consumer consumption function Runnable no parameter no return function The Function function takes a parameter and returns a value. Supplier, Consumer and Runnable can be regarded as a special form of Function Use tips Handle if that throws an exception Handle if branch operations If a value […]

Use the Function interface in Java 8 to eliminate if…else (a very novel way of writing)

Source: juejin.cn/post /7011435192803917831 Welcome to join Xiaoha’s Planet, you will get: Exclusive project practice/Java learning route/One-on-one questions/Learning check-in/Gift book benefits Currently, I am leading my friends to work on the first project within the planet: Full StackSeparation of front-end and back-end blog, hands-on, back-end + front-end full-stack development, from 0 to 1 Explain the development […]

Writing a Simple Garbage Collector in C

Article directory Make malloc Mark and scan Scan the heap Scan a continuous area Find data segment Find the bottom of the call stack Integrate Writing a simple garbage collector in C (maplant.com) Make malloc Header describes memory block typedef struct header {<!– –> unsigned int size; struct header *next; } header_t; Dynamically allocated memory […]