When lombok and mapstruct are used at the same time; the get and set methods of the pojo class fail to be generated, and the implementation class of mapstruct fails to be generated. It is just a new object.

Project scenario: When lombok and mapstruct are used at the same time; the get and set methods of the pojo class fail to be generated, and the implementation class of mapstruct fails to be generated. It is just a new object. Project related background: In recent work, I have been converting objects related to DTO, […]

Springboot Cangqiong takeaway actual combat: 1. Environment construction (nginx startup failure solution + Entity, DTO, VO, POJO difference explanation + nio.charset.Input length = 2 error report solution)

Environment setup Front-end environment construction There is a “front-end operating environment” folder in day01 of the information. Extract the “nginx-1.20.2” folder to non-Chinese directory, and then directly click nginx in the folder .exe (it doesn’t matter if it crashes). Then enter localhost directly in the browser. If the following page appears, it means the front […]

Mybatis enables reverse engineering to automatically generate mapper and pojo—–Mybatis framework based on database information

Username and password to connect to the database, dynamically generate database information for use The forward direction is from the java program to the database table, and the reverse direction is to reversely deduce the content required by the java program from the database table. pojo class name, package name and generation location mapper file […]

Mybatis enables reverse engineering to automatically generate mapper and pojo tests—–Mybatis framework

<?xml version=”1.0″ encoding=”UTF-8″?> <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <groupId>com.powernode</groupId> <artifactId>mybatis-012-generator1</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.33</version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.10</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.2.11</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.13.2</version> <scope>test</scope> </dependency> </dependencies> <properties> <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <!– Configure the plug-in for mybatis reverse engineering, build means building reverse engineering–> <build> […]

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 […]

Mybatis uses insert to complete the ORM mapping of POJO classes and pass parameters —–Mybatis framework

CRUD(C:Create,R:Retrieve(check),U:Update,D:Delete) <insert id=”insertCar”> insert into t_car(id,car_num,brand,guide_price,produce_time,car_type) values(null,’1003′,’Toyota Overbearing’,30.0,’2000-10-11′,’Fuel vehicle’) </insert> The value written in this way is hard-coded into the configuration file. This cannot exist in actual development. The data must be submitted by the front-end Form form. Pass value to sql statement SQL statement insert into user(id,username) values(?,?) in jdbc prepareStatement.setString(1,zhangSan); What is used […]

PO, VO, BO, DO, DAO, DTO, POJO

PO, VO, BO, DO, DAO, DTO, POJO Summary: Introduction: Configuration method: Configuration steps: PO – Persistent Object VO – Value Object BO – Business Object DO – Data Object DAO – Data Access Object DTO – Data Transfer Object POJO – Plain Old Java Object Summarize: Case DEMO References: Blogger Moyu takes you Go to […]

jpa query returns custom objects, returns specified VO, POJO

jpa query returns custom objects, returns specified VO, POJO The jpa query returns custom objects, returns the specified VO, POJO, and JPA will do a lot of processing before the query, as well as thread notification operations. If the concurrency is large, the processing performance will plummet. But because jpa has done a lot of […]

13_Pulsar connects to Flink to complete data preprocessing, preprocessing requirements description, build Maven project, add dependencies, add related POJO classes, write Flink code, process data, test whether data can be written back to Pulsar normally

3.6. Pulsar connects to Flink to complete data preprocessing 3.6.1. Description of preprocessing requirements 3.6.2. Build the Maven project and add dependencies 3.6.3. Add related POJO classes 3.6.4. Write Flink code to process data 3.6.5. Test whether the data can be written back to Pulsar normally 3.6. Pulsar connects to Flink to complete data preprocessing […]