On behalf of the Spring Batch team, I am pleased to announce that Spring Batch 4.3.0-M1 is now available from our milestone repository.
This release is packed with new features, performance improvements, and bug fixes, as well as documentation and dependency updates! You can find the complete list of changes in the release notes, but here are the major highlights:
ItemStreamWriter
Similar to the SynchronizedItemStreamReader
, we added a SynchronizedItemStreamWriter
. This feature is useful in multi-threaded steps where concurrent threads need to be synchronized to not override each other’s writes.
JpaPagingItemReader
Up until now, it was possible to use named queries with the JpaPagingItemReader
. However, this required the creation of a custom query provider, as follows:
JpaPagingItemReader<Foo> reader = new JpaPagingItemReaderBuilder<Foo>()
.name("fooReader")
.queryProvider(new AbstractJpaQueryProvider() {
@Override
public Query createQuery() {
return getEntityManager().createNamedQuery("allFoos", Foo.class);
}
@Override
public void afterPropertiesSet() throws Exception {
}
})
// set other properties on the reader
.build();
COPY
In this release, we introduced a JpaNamedQueryProvider
next to the JpaNativeQueryProvider
to ease the configuration, which can now be written like this:
JpaPagingItemReader<Foo> reader = new JpaPagingItemReaderBuilder<Foo>()
.name("fooReader")
.queryProvider(new JpaNamedQueryProvider("allFoos", Foo.class))
// set other properties on the reader
.build();
#spring