Let’s talk briefly about JPA and SpringDataJPA

1.What is JPA? The full name of JPA is the abbreviation of Java Persistence API. The Chinese name is: java persistence layer API. It is the mapping relationship between JDK5.0 annotations or XML description objects and relational tables, and persists the test object of the runner into the database. It can be understood as , […]

SpringBoot+SpringDataJpa general audit logic

SpringBoot + SpringDataJpa general audit logic Scene Recently I wrote a small tool for sql simulation data, which involves the review of submitted table data, review of submitted field data, and review of some keywords, and these review logics are the same. Assuming that they are written one by one, then Basically, the same code […]

Microservice Development – Conditional Query (Springboot+SpringDataJPA)

1. Database table: 2. Entity class: @Entity @Table(name=”tb_label”) public class Label { @Id private String id;// private String labelname;//label name private String state;//state private Long count;//use quantity private Long fans;//Number of followers private String recommend;//Whether it is recommended Tool class: public class IdWorker { // The starting point of the time, as a reference, generally […]

Spring integrates dataJPA

1. Introductory case 1.1 Overall project structure table: sql DROP TABLE IF EXISTS t_user; CREATE TABLE t_user ( user_id int(0) NOT NULL AUTO_INCREMENT, user_name varchar( 255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, real_name varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL, PRIMARY KEY (user _id) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT […]

springDatajpa dynamic sql exports data to excel according to the time range and uses vue button to trigger

Technical points used: 1. springDatajpa 2. EasyExcel 3. Database 4. vue Front-end implementation: 1. Create button (click this button to pop up a pop-up box to fill in the export conditions) <el-button type=”primary” round @click=”dialogVisible = true”><svg-icon icon-class=”jurassic” /> & amp;nbsp; & amp;nbsp;export</el- button> //================================== <el-dialog title=”Export Conditions” :visible.sync=”dialogVisible” width=”30%” > <el-form ref=”exportConditionForm” :model=”exportCondition” :rules=”exportConditionRules” […]

SpringDataJPA custom joint query, Group by query

1. Paging custom joint query – NativeQuery /** * The receiving class needs to be consistent with the field of the query */ @Data @Schema(title = “Approval Form, Approval Collaborative Page Query Information”) @AllArgsConstructor @NoArgsConstructor public class ApprovalPageRspVO implements Serializable {<!– –> private static final long serialVersionUID = 1L; @Schema(description = “approval id”) private BigInteger […]

Solve the problem that the creation order of the entity class table fields of the SpringDataJpa framework is inconsistent with the display order of the database table fields

yml configuration: spring: datasource: driverClassName: com.mysql.cj.jdbc.Driver type: com.alibaba.druid.pool.DruidDataSource jpa: show-sql: false hibernate: ddl-auto: update Entity class code: @Getter @Setter @Entity @Table(name = “t_db_bo_report”) public class UnreturnedFaultyBoReport extends BaseEntity { private static final long serialVersionUID = 1L; private String rmaLine; private String odaName; private String faultyChasing; private String yearMonthValue; private String remarks; } After running, it […]

The excellence of SpringDataJPA and Mybatis

Click on the blue words to follow us! A public account that is working hard All the good-looking people pay attention First of all, to express my personal opinion, JPA must be the first choice. I personally think that it is not enough to really compare the two frameworks just to discuss the difference between […]

[Solved] [tomcat startup error] Failed to start connector [Connector[AJP/1.3-xxxx]]

1. Description of the problem After upgrading the tomcat version, copy the project-related service configuration in the original old version server.xml, and start the error 2. Reason for the problem The AJP-related configuration in the old version of tomcat does not apply to the configuration of the new version. It involves a high-risk vulnerability in […]