public class JpaPagingItemReaderBuilder<T>
extends java.lang.Object
Constructor and Description |
---|
JpaPagingItemReaderBuilder() |
Modifier and Type | Method and Description |
---|---|
JpaPagingItemReader<T> |
build()
Returns a fully constructed
JpaPagingItemReader . |
JpaPagingItemReaderBuilder<T> |
currentItemCount(int currentItemCount)
Index for the current item.
|
JpaPagingItemReaderBuilder<T> |
entityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)
The
EntityManagerFactory to be used for executing the configured
queryString . |
JpaPagingItemReaderBuilder<T> |
maxItemCount(int maxItemCount)
Configure the max number of items to be read.
|
JpaPagingItemReaderBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
JpaPagingItemReaderBuilder<T> |
pageSize(int pageSize)
The number of records to request per page/query.
|
JpaPagingItemReaderBuilder<T> |
parameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
A map of parameter values to be set on the query.
|
JpaPagingItemReaderBuilder<T> |
queryProvider(JpaQueryProvider queryProvider)
A query provider.
|
JpaPagingItemReaderBuilder<T> |
queryString(java.lang.String queryString)
The HQL query string to execute.
|
JpaPagingItemReaderBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
JpaPagingItemReaderBuilder<T> |
transacted(boolean transacted)
Indicates if a transaction should be created around the read (true by default).
|
public JpaPagingItemReaderBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic JpaPagingItemReaderBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public JpaPagingItemReaderBuilder<T> maxItemCount(int maxItemCount)
maxItemCount
- the max items to be readAbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
public JpaPagingItemReaderBuilder<T> currentItemCount(int currentItemCount)
currentItemCount
- current indexAbstractItemCountingItemStreamItemReader.setCurrentItemCount(int)
public JpaPagingItemReaderBuilder<T> pageSize(int pageSize)
pageSize
- number of itemsAbstractPagingItemReader.setPageSize(int)
public JpaPagingItemReaderBuilder<T> parameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
parameterValues
- map of valuesJpaPagingItemReader.setParameterValues(Map)
public JpaPagingItemReaderBuilder<T> queryProvider(JpaQueryProvider queryProvider)
queryString(String)
have not
been set.queryProvider
- the query providerJpaPagingItemReader.setQueryProvider(JpaQueryProvider)
public JpaPagingItemReaderBuilder<T> queryString(java.lang.String queryString)
queryProvider(JpaQueryProvider)
has not been set.queryString
- the HQL queryJpaPagingItemReader.setQueryString(String)
public JpaPagingItemReaderBuilder<T> transacted(boolean transacted)
transacted
- defaults to trueJpaPagingItemReader.setTransacted(boolean)
public JpaPagingItemReaderBuilder<T> entityManagerFactory(javax.persistence.EntityManagerFactory entityManagerFactory)
EntityManagerFactory
to be used for executing the configured
queryString
.entityManagerFactory
- EntityManagerFactory
used to create
EntityManager
public JpaPagingItemReader<T> build()
JpaPagingItemReader
.JpaPagingItemReader