public class HibernatePagingItemReaderBuilder<T>
extends java.lang.Object
HibernatePagingItemReader
. When configuring, only one of the
following should be provided:
HibernatePagingItemReader
Constructor and Description |
---|
HibernatePagingItemReaderBuilder() |
Modifier and Type | Method and Description |
---|---|
HibernatePagingItemReader<T> |
build()
Returns a fully constructed
HibernatePagingItemReader . |
HibernatePagingItemReaderBuilder<T> |
currentItemCount(int currentItemCount)
Index for the current item.
|
HibernatePagingItemReaderBuilder<T> |
fetchSize(int fetchSize)
Fetch size used internally by Hibernate to limit amount of data fetched
from database per round trip.
|
HibernatePagingItemReaderBuilder<T> |
maxItemCount(int maxItemCount)
Configure the max number of items to be read.
|
HibernatePagingItemReaderBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
HibernatePagingItemReaderBuilder<T> |
pageSize(int pageSize)
The number of records to request per page/query.
|
HibernatePagingItemReaderBuilder<T> |
parameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
A map of parameter values to be set on the query.
|
HibernatePagingItemReaderBuilder<T> |
queryName(java.lang.String queryName)
The name of the Hibernate named query to be executed for this reader.
|
HibernatePagingItemReaderBuilder<T> |
queryProvider(HibernateQueryProvider<T> queryProvider)
A query provider.
|
HibernatePagingItemReaderBuilder<T> |
queryString(java.lang.String queryString)
The HQL query string to execute.
|
HibernatePagingItemReaderBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
HibernatePagingItemReaderBuilder<T> |
sessionFactory(org.hibernate.SessionFactory sessionFactory)
The Hibernate
SessionFactory to execute the query against. |
HibernatePagingItemReaderBuilder<T> |
useSatelessSession(boolean useStatelessSession)
Deprecated.
This method is deprecated in favor of
useStatelessSession(boolean) and will be
removed in a future version. |
HibernatePagingItemReaderBuilder<T> |
useStatelessSession(boolean useStatelessSession)
Indicator for whether to use a
StatelessSession
(true ) or a Session (false ). |
public HibernatePagingItemReaderBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic HibernatePagingItemReaderBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public HibernatePagingItemReaderBuilder<T> maxItemCount(int maxItemCount)
maxItemCount
- the max items to be readAbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
public HibernatePagingItemReaderBuilder<T> currentItemCount(int currentItemCount)
currentItemCount
- current indexAbstractItemCountingItemStreamItemReader.setCurrentItemCount(int)
public HibernatePagingItemReaderBuilder<T> pageSize(int pageSize)
pageSize
- number of itemsAbstractPagingItemReader.setPageSize(int)
public HibernatePagingItemReaderBuilder<T> parameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
parameterValues
- map of valuesHibernatePagingItemReader.setParameterValues(Map)
public HibernatePagingItemReaderBuilder<T> queryName(java.lang.String queryName)
queryName
- name of the query to executeHibernatePagingItemReader.setQueryName(String)
public HibernatePagingItemReaderBuilder<T> fetchSize(int fetchSize)
fetchSize
- number of recordsHibernatePagingItemReader.setFetchSize(int)
public HibernatePagingItemReaderBuilder<T> queryProvider(HibernateQueryProvider<T> queryProvider)
queryString(String)
and
queryName(String)
have not been set.queryProvider
- the query providerHibernatePagingItemReader.setQueryProvider(HibernateQueryProvider)
public HibernatePagingItemReaderBuilder<T> queryString(java.lang.String queryString)
queryProvider(HibernateQueryProvider)
and queryName(String)
have
not been set.queryString
- the HQL queryHibernatePagingItemReader.setQueryString(String)
public HibernatePagingItemReaderBuilder<T> sessionFactory(org.hibernate.SessionFactory sessionFactory)
SessionFactory
to execute the query against.sessionFactory
- the session factoryHibernatePagingItemReader.setSessionFactory(SessionFactory)
@Deprecated public HibernatePagingItemReaderBuilder<T> useSatelessSession(boolean useStatelessSession)
useStatelessSession(boolean)
and will be
removed in a future version.StatelessSession
(true
) or a Session
(false
).useStatelessSession
- Defaults to falseHibernatePagingItemReader.setUseStatelessSession(boolean)
public HibernatePagingItemReaderBuilder<T> useStatelessSession(boolean useStatelessSession)
StatelessSession
(true
) or a Session
(false
).useStatelessSession
- Defaults to falseHibernatePagingItemReader.setUseStatelessSession(boolean)
public HibernatePagingItemReader<T> build()
HibernatePagingItemReader
.HibernatePagingItemReader