This is the third part in a series of blog posts highlighting some of the new features available in Spring Integration 2.2 following the recent release of Release Candidate 1. The first part described the new set of MongoDB adapters. In part two we highlighted the new extended support for synchronizing non-transactional resources with transactions.
In this third part today, we would like to introduce the new Java Persistence API (JPA) support that is provided starting with Spring Integration 2.2. The JPA module is persistence-provider-agnostic and has been tested using:
As part of the new JPA module, we provide several components for retrieving and persisting JPA entity objects:
- JPA Inbound Channel Adapter
- JPA Outbound Channel Adapter
- JPA Updating Outbound Gateway
- JPA Retrieving Outbound Gateway
Using these components, you can select, create, update and delete entities in your database. Besides persisting data using the entity classes directly, you can also execute queries using the
Java Persistence Query Language (JPQL) as well as using native SQL queries. Additionally, named queries are supported as well.
The JPA Sample
In our
Spring Integration Samples repository, we provide
a sample application demonstrating the JPA support, which we want to use in this blog post to show you how to easily get started.
The provided sample is using an embedded H2 database which contains a single table called PEOPLE. This table is mapped to the Person entity class in package org.springframework.integration.samples.jpa…