In order to improve search efficiency, a database constructs a binary search tree (BST) for a certain integer field.

Disclaimer: The following method is not necessarily correct. It was written during personal study and has not been tested extensively. It is for reference only. There may be bugs and will not be changed for the time being. Description: In order to improve search efficiency, a database constructs a binary search tree (BST) for a […]

Why you should stop using field annotations in SpringBoot and use constructor injection instead

Stop using field injection in SpringBoot! This article is a translation, and I have added some of my own understanding. Translation source: https://medium.com In the context of Spring Boot dependency injection, there is a debate about best practices for injecting dependencies: field injection, setter injection, and constructor injection. ?In this article, we will focus on […]

Spring’s @FieldDefaults and @Data: Lombok annotations for cleaner code

Introduction As Java developers, we often find ourselves stuck in boilerplate code. Accessor methods, modifier methods, constructors, equals(), hashCode(), and toString() are essential, but take up a lot of space and distract from the core logic of the application. The Spring framework is widely used for building enterprise applications and is a fan of reducing […]

SpringBoot_mybatis-plus uses json fields

mybatis-plus uses json fields 1 Introduction 2.Program analysis 2.1 Why json 2.2 Database selection 3. Actual combat 3.1 Use text field (h2 database) 3.1.1 Table creation statement 3.1.2 Data operation and query 3.2 Using json fields (mysql database) 3.2.1 Table creation statement 3.2.2 Data operation and query 4. Appendix 4.1 MySQL JSON index usage 4.2 […]

Public field automatic filling, dish management

1. Public field filling 1.1. Problem analysis 1.2. Implementation ideas 1.3, Code Development 1.3.1, Custom annotations import com.sky.enumeration.OperationType; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Target(ElementType.METHOD) @Retention (RetentionPolicy.RUNTIME) public @interface AutoFill { //Specify the type of database operation through the enumeration type //UPDATE INSERT OperationType value(); } 1.3.2, Aspect class import com.sky.annotation.AutoFill; import com.sky.constant.AutoFillConstant; […]

When the verification rules need to change according to conditions, use computed (a certain field contains multiple objects that need to be verified)

Requirement description: Verification form 1. When the area is mainland China, the mobile phone number is required but the contact number is not required; otherwise, the opposite is true. 2. Each email address should conform to the correct email format; when the warehouse type is a virtual warehouse, the email address is required, and in […]

ApiSix plug-in Basic-Auth adds a backup password field to achieve smooth password switching

ApiSix plug-in Basic-Auth adds a backup password field to achieve smooth password switching Introduction Technology stack introduction ApacheAPISIX Consumer Consumer Plugin Basic-Auth cause measure Modify the source code basic-auth.lua Modify consumer configuration test other instructions Introduction This article introduces how to add the backup password field backuo_password to the plug-in Basic-Auth in ApiSix to achieve […]