Category:Java

  • Mybatis parameter processing

    Time:2021-12-30

    Series articles: Getting started with mybatis Mybatis configuration Mybatis get self incrementing primary key Mybatis parameter processing Mybatis returns results Mybatis dynamic SQL Mybatis cache Mybatis load profile Load mapper mapping file Mybatis interface binding principle Mybatis SQL execution Parameter processing Single parameter adopt#{parameter name}Take out the parameter value The interface is defined as follows […]

  • Java controls the probability of random numbers

    Time:2021-12-30

    //App status The second scheme is the method of generating a new weight value array /** Reference link Java controls the probability of random numbers This work adoptsCC agreement, reprint must indicate the author and the link to this article

  • SA token annotation authentication: elegant separation of authentication and business code!

    Time:2021-12-30

    SA token annotation authentication: elegant separation of authentication and business code! SA token introduction: SA token is a lightweight Java permission authentication framework, which mainly solves the following problems:Login authentication、Authority authentication、Session session、Single sign on、OAuth2.0、Microservice gateway authenticationAnd a series of permission related problems. Today, we will mainly introduce the in SA tokenAnnotation authentication, it allows us […]

  • Deep research on Java development pattern

    Time:2021-12-30

    catalogue 1、 Simple factory mode 2、 Factory method model Summary 3、 Abstract factory pattern summary The factory pattern mainly provides an interface for creating objects. Factory patterns are divided into three categories according to the formulation in Java and patterns: Simple factory mode(Simple Factory) Factory method model(Factory Method) Abstract factory pattern(Abstract Factory) These three patterns […]

  • Mybatis returns results

    Time:2021-12-29

    Series articles: Getting started with mybatis Mybatis configuration Mybatis get self incrementing primary key Mybatis parameter processing Mybatis returns results Mybatis dynamic SQL Mybatis cache Mybatis load profile Load mapper mapping file Mybatis interface binding principle Mybatis SQL execution Automatic mapping Mybatis will get the column name returned in the result and find the attribute […]

  • Java 8 stream API to kotlin collection API

    Time:2021-12-29

    The API for collection operations provided by kotlin is much simpler than that of Java 8 stream. The following is the transformation from Java 8 stream API to kotlin collection API. Map attributes aggregated into lists Java List names = users.stream().map(User::getName).collect(Collectors.toList()); kotlin val list = user. Map {it. Name} / / tolist() is not required, […]

  • Hands on implementation of a jump table

    Time:2021-12-29

    preface This paper mainly introduces the characteristics of jump table and how to implement a jump table by yourself. Skip list Jump table is a typical space for time model. The underlying data structure is an ordered single linked tableMultilayer index, the binary search method is implemented to query data. Multi tier index not only […]

  • Solve the bug encountered in the integration of mybatisplus sub module management in springboot

    Time:2021-12-29

    preface The bug tossed around for two days to find the answer. Although it is not a two-day working time to debug this problem, the process is really tortuous, so making a record is also regarded as a self reflection background POM dependency of springboot and mybatis plus <!– Springboot version — > <parent> <groupId>org.springframework.boot</groupId> […]

  • Sword finger offer plan 13 (double pointer simple) — Java

    Time:2021-12-28

    1.1 topic 1 Sword finger offer 21 Adjust the array order so that odd numbers precede even numbers 1.2 solution Classic double pointer. Judge whether it is an even number by% 2There is a trap here. Pay attention to the loop inside. You need to add judgment 1.3 code class Solution { public int[] exchange(int[] […]

  • Implementation of spring boot 2.0 mybatis mapper locations scanning multiple paths

    Time:2021-12-28

    Springboot 2.0 mybatis mapper locations scans multiple paths Mapper locations scans multiple paths, separated by, If mapper XML is configured asclasspath*It works better at the beginning mybatis: mapper-locations: classpath*:mapper/*.xml,classpath*:com/urthink/upfs/**/*Mapper.xml type-aliases-package: com.urthink.upfs.springbootmybatis.entity #Identity: how MySQL # retrieves the primary key #Notempty: false #insert and update, whether to judge the string type! = ” configuration: #During automatic […]

  • Interviewer: what expansion plans does redis have?

    Time:2021-12-27

    Author: vtSource:https://juejin.im/post/5eb0e724e51d454d89440da2 preface Redis is no stranger to everyone. Even if it has not been used, everyone has heard of it. As one of the most widely used kV memory databases, in today’s era of large traffic, the single machine mode is slightly thin, so it is inevitable to have some expansion schemes. The author […]

  • Deep understanding of Java exception handling

    Time:2021-12-27

    catalogue Picture analysis: Exception handling: Processing mechanism 1: try catch finally Finally: Processing mechanism 2: throws + exception type How to select two processing methods in development? How to customize exception classes? The difference between throw and throws: summary Picture analysis: 1. The process of generating bytecode files may generate compile time exceptions (checked). From […]