This article mainly introduces generic programming, function templates and class templates. Table of Contents 1. Generic programming 2. Function template 1. Function template concept 2. Function template format 3. Principle of function template 4. Instantiation of function templates 5. Matching principles of template parameters 3. Class template 1. Definition format of class template 2. Instantiation […]
Tag: class
The information returned by the Mybatis query result set is encapsulated using a large Map to implement mapping without POJO classes and achieve the effect of corresponding values —–Mybatis framework
package com.powernode.mybatis.mappers; import com.powernode.mybatis.POJO.Car; import org.apache.ibatis.annotations.MapKey; import java.util.List; import java.util.Map; public interface CarMapper { //Query all Cars and return a Map collection //The Key of the map collection is the primary key value, and the map value is the Car object @MapKey(“id”) Map<Long,Map<String,Object>> selectMap(); List<Map<String,Object>> selectAllCar(); Map<String,Object> selectByIdGetMap(Long id); List<Car> selectByCarId(Long id); //There may be […]
The information returned by the Mybatis query result set uses ResultMap to implement the encapsulated POJO class—–Mybatis framework
<?xml version=”1.0″ encoding=”UTF-8″?> <!DOCTYPE mapper PUBLIC “-//mybatis.org//DTD Mapper 3.0//EN” “http://mybatis.org/dtd/mybatis-3-mapper.dtd”> <mapper namespace=”com.powernode.mybatis.mappers.CarMapper”> <select id=”selectById” resultType=”Car”> select id as id, car_num as carNum, brand as brand, guide_price as guidePrice, produce_time as produceTime, car_type as carType from t_car where id = #{id}; </select> <select id=”selectAll” resultType=”Car”> select id as id, car_num as carNum, brand as brand, guide_price […]
SpringBoot-thread pool ThreadPoolExecutor asynchronous processing (including split collection tool class)
ThreadPoolExecutor VS ThreadPoolTaskExecutor ThreadPoolTaskExecutor encapsulates ThreadPoolExecutor. Configuration file application.yml # Asynchronous thread configuration custom usage parameters async: executor: thread: core_pool_size: 10 max_pool_size: 100 # Configure the maximum number of threads queue_capacity: 99988 # Configure queue size keep_alive_seconds: 20 #Set the thread idle waiting time seconds name: prefix: async-thread- # Configure the name prefix of threads […]
Javase | Date class, SimpleDateFormat class, System class
Directory: 1.Date class (date class) 1.1 Constructor method of Date class publicDate( ) public Date(long date) 2.SimpleDateFormat class (simple date format class) 2.1 Definition of SimpleDateFormat class 2.2 Construction method of SimpleDateFormat SimpleDateFormat( ) SimpleDateFormat(String pattern) date format symbol 3. Convert “Date type” to “date string String” 4. Convert “date string String” to “Date type” […]
[Java IO stream – Special offer for Mid-Autumn Festival] Classification of streams, API usage, file operations
Blogger: _LJaXi Column: Java | From cross-platform to cross-industry Development tools: IntelliJ IDEA Community Edition 2022.3.3 Java IO stream Mid-Autumn Festival special offer Java Io what is flow Classification of flows file byte input stream 1. Conditional loop solution 1 (2) Read characteristics 2. Array storage solution file byte output stream Output stream construction method […]
[03_03_JS Advanced] 04_this, class encapsulation and inheritance, copying
this Default value [ordinary function] The calling method of ordinary functions determines the value of this, that is, who calls this and to whom the value points. <script type=”text/javascript”> \t\t // console.log(this); // this points to: window \t\t // 1. Ordinary function: window, caller // function fn () { // console.log(this); // } // fn(); […]
[Algorithm] Search class – binary search algorithm
Summary of binary search algorithm Algorithm description This algorithm is a search algorithm. When you need to find an element from an ordered array, you can use this algorithm to find it. (This article assumes that the array is in ascending order) Algorithmic Thought Each time a half search is performed, the middle element value […]
JavaScript built-in classes
1. Understand packaging types 1. Primitive type packaging class JavaScript’s primitive types are not object types, so theoretically, they have no way to obtain properties or call methods. However, in development we will see that we often do this: var message = “hello world”; var words = message.split(” “); var length = message.length; var num […]
Experiment 3 Class Inheritance and Polymorphism Experiment
1. Experiment purpose 1. Master the inheritance methods of classes and the method calls of up-transformed objects. 2. Master the difference and use of this and super. 3. Understand the concepts and functions of abstract classes, and master the declaration, implementation and interface callbacks of interfaces. 2. Experimental content 7173 Now define a class system, […]