Dynamic addition and dynamic switching of data sources based on AbstractRoutingDataSource

Realize dynamic addition and dynamic switching of data sources based on AbstractRoutingDataSource Purpose: Dynamically manage and switch data sources after the project is running, including setting the default data source, initializing the data source, adding, deleting, and switching data sources, etc. Inherit AbstractRoutingDataSource and override its determineCurrentLookupKey() method to determine the identity of the data […]

Use TransBigData to quickly and efficiently process, analyze, and mine taxi GPS data

01, Introduction to TransBigData TransBigData is a Python package developed for traffic spatiotemporal big data processing, analysis and visualization. TransBigData provides a fast and concise method for processing common traffic spatio-temporal big data (such as taxi GPS data, shared bicycle data and bus GPS data, etc.). TransBigData provides a variety of processing methods for various […]

Database access middleware — basic use of springdata-jpa

2. Single table SQL operation – using keywords to piece together review public interface UserRepository extends JpaRepository<User,Integer> {<!– –> User findByUsernameLike(String username); } @GetMapping(“/user/username/{username}”) public Object findUserByUsername(@PathVariable String username){<!– –> return userRepository. findByUsernameLike(“%” + username + “%”); } 1. Single table sql operation – the method of using keywords to piece together keyword example JPQL […]

SpringBoot integrates SpringData JPA

SpringBoot integrates SpringData JPA Next section through train JPA’s one-to-one, one-to-many, many-to-many queries Introduction JPA (Java Persistence API) means Java Persistence API. It is the Java Persistence Specification (JSR 338) officially proposed by Sun after JDK5.0. The package of these interfaces is javax.persistence. Details can be found in Refer to https://github.com/javaee/jpa-spec The emergence of JPA […]

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

Use SpringDataRedis to operate the Redis database

Using Spring Data Redis to operate Redis springboot integrates Redis First introduce the Spring Data Redis module in the pom file of maven, the code is as follows. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> Then, write the redis configuration in the springboot configuration file, the code is as follows. spring: application: name:redisdemo #Redis related configuration redis: host: […]

Use of ElasticSearch8.7 with SpringDataElasticSearch5.1

0. Preface finally! finally! I rummaged through the articles on the Internet by myself, and rummaged through the documents and API of the official website, and finally understood what was updated about this thing! This article will take you to understand, use SpringDataES5.1 to ES8.7 [add, modify, delete, multi-condition query, aggregation] and other operations I […]

[Springdata Jpa framework application]

Directory Preface: Spring Data JPA provides many functions, including the following: Queries based on convention function naming The corresponding SQL statement can be automatically generated according to the method name, for example: Use the @Query annotation to customize query statements, such as: It should be noted that if you use SQL syntax, you need to […]

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