For the latest stable version, please use Spring Integration 6.3.4!spring-doc.cn

For the latest stable version, please use Spring Integration 6.3.4!spring-doc.cn

Spring Integration’s JPA (Java Persistence API) module provides components for performing various database operations using JPA.spring-doc.cn

You need to include this dependency into your project:spring-doc.cn

<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-jpa</artifactId>
    <version>6.2.9</version>
</dependency>
compile "org.springframework.integration:spring-integration-jpa:6.2.9"

The JPA API must be included via some vendor-specific implementation, e.g. Hibernate ORM Framework.spring-doc.cn

The following components are provided:spring-doc.cn

These components can be used to perform select, create, update, and delete operations on the target databases by sending and receiving messages to them.spring-doc.cn

The JPA inbound channel adapter lets you poll and retrieve (select) data from the database by using JPA, whereas the JPA outbound channel adapter lets you create, update, and delete entities.spring-doc.cn

You can use outbound gateways for JPA to persist entities to the database, letting you continue the flow and execute further components downstream. Similarly, you can use an outbound gateway to retrieve entities from the database.spring-doc.cn

For example, you may use the outbound gateway, which receives a Message with a userId as payload on its request channel, to query the database, retrieve the user entity, and pass it downstream for further processing.spring-doc.cn

Recognizing these semantic differences, Spring Integration provides two separate JPA outbound gateways:spring-doc.cn