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+ThreadLocal+AbstractRoutingDataSource implements dynamic switching of data sources

Hi, everyone, I am the fat boy who grabs my wife’s yogurt. Recently, when doing business requirements, I need to obtain data from different databases and then write them into the current database, so it involves switching data sources. Originally I wanted to use the dynamic data source SpringBoot starter provided in Mybatis-plus: dynamic-datasource-spring-boot-starter to […]

Development environment construction based on SpringBoot framework: use of SpringData JPA

The previous article has described how to build a Springboot environment and integrate mysql database Development environment construction based on SpringBoot framework: project creation + integrated database 3. Query operation of SpringData JPA SpringData JPA has 5 core interfaces: Repository: It is the top-level interface. It is an empty interface. The purpose is to unify […]

springdata-jpa multiple data source configuration

Project structure 1. Dependence <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.18</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <!– MySQL driver, note, this needs to correspond to the MySQL version –> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.31</version> <scope>runtime</scope> </dependency> <!–web–> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!–fastjson–> <dependency> <groupId>com.alibaba.fastjson2</groupId> <artifactId>fastjson2</artifactId> <version>2.0.4</version> </dependency> </dependencies> 2.application.yml server: port: 8900 #Port […]

[BigData] Flink (framework principle)

Article directory Flink overview Flink vs SparkStreaming Deployment mode Session Mode Per-Job Mode application mode YARN operating mode (key points) Flink runtime architecture Parallelism Operator Chain Task Slots The relationship between task slots and parallelism Assignment submission process Flink Overview What is Flink Stateful stream processing Stateful Stream Processing refers to a streaming computing model […]

Jetpack data bindingDataBinding

DataBinding DataBinding is a technology commonly used in software development for binding data models to user interfaces. Through DataBinding, we can realize automatic updating and two-way binding of data, so that data changes can be automatically reflected on the interface, and user operations on the interface can also be automatically updated into the data model. […]

Elasticsearch integration—framework integration SpringData-integration test-index operation

1.Spring Data Framework introduction Spring Data It is a tool used to simplify database, non-relational database, index library access, and supports cloud services. Open source framework. Its main goal is to make access to data easy and fast, and to support map-reduce Frameworks and cloud computing Computing data services. Spring Data can be greatly simplified […]

SpringDataRedis uses

1. Features of Spring Data Redis 2. Steps using SpringDataRedis 3. Customize RedisTemplate serialization 4. SpringDataRedis operation object 1. Features of SpringDataRedis Provides integration with different Redis clients (Lettuce and Jedis) Provides RedisTemplate unified API to operate Redis Support Redis publish-subscribe model Support for Redis Sentinel and Redis Cluster Support for Lettuce-based reactive programming Supports […]

AbstractRoutingDataSource, spring configuration multiple data source issues

AbstractRoutingDataSource, spring configuration multiple data source issues First introduce pom.xml dependencies <!–Test–> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>2.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> <version>2.3.12.RELEASE</version> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.1.1</version> </dependency> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.13</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>1.1.18</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-generator</artifactId> <version>3.1.1</version> </dependency> Add configuration in application.yml spring: application: name: tms […]

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