public class HibernateCursorItemReaderBuilder<T>
extends java.lang.Object
HibernateCursorItemReader
. When configuring, one of
the following should be provided (listed in order of precedence):
HibernateCursorItemReader
Constructor and Description |
---|
HibernateCursorItemReaderBuilder() |
Modifier and Type | Method and Description |
---|---|
HibernateCursorItemReader<T> |
build()
Returns a fully constructed
HibernateCursorItemReader . |
HibernateCursorItemReaderBuilder<T> |
currentItemCount(int currentItemCount)
Index for the current item.
|
HibernateCursorItemReaderBuilder<T> |
entityClass(java.lang.Class<T> nativeClass) |
HibernateCursorItemReaderBuilder<T> |
fetchSize(int fetchSize)
The number of items to be returned with each round trip to the database.
|
HibernateCursorItemReaderBuilder<T> |
maxItemCount(int maxItemCount)
Configure the max number of items to be read.
|
HibernateCursorItemReaderBuilder<T> |
name(java.lang.String name)
The name used to calculate the key within the
ExecutionContext . |
HibernateCursorItemReaderBuilder<T> |
nativeQuery(java.lang.String nativeQuery)
Used to configure a
HibernateNativeQueryProvider . |
HibernateCursorItemReaderBuilder<T> |
parameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
A map of parameter values to be set on the query.
|
HibernateCursorItemReaderBuilder<T> |
queryName(java.lang.String queryName)
The name of the Hibernate named query to be executed for this reader.
|
HibernateCursorItemReaderBuilder<T> |
queryProvider(HibernateQueryProvider<T> queryProvider)
A query provider.
|
HibernateCursorItemReaderBuilder<T> |
queryString(java.lang.String queryString)
The HQL query string to execute.
|
HibernateCursorItemReaderBuilder<T> |
saveState(boolean saveState)
Configure if the state of the
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes. |
HibernateCursorItemReaderBuilder<T> |
sessionFactory(org.hibernate.SessionFactory sessionFactory)
The Hibernate
SessionFactory to execute the query against. |
HibernateCursorItemReaderBuilder<T> |
useStatelessSession(boolean useStatelessSession)
Indicator for whether to use a
StatelessSession
(true ) or a Session (false ). |
public HibernateCursorItemReaderBuilder<T> saveState(boolean saveState)
ItemStreamSupport
should be persisted within the ExecutionContext
for restart purposes.saveState
- defaults to truepublic HibernateCursorItemReaderBuilder<T> name(java.lang.String name)
ExecutionContext
. Required if
saveState(boolean)
is set to true.name
- name of the reader instanceItemStreamSupport.setName(String)
public HibernateCursorItemReaderBuilder<T> maxItemCount(int maxItemCount)
maxItemCount
- the max items to be readAbstractItemCountingItemStreamItemReader.setMaxItemCount(int)
public HibernateCursorItemReaderBuilder<T> currentItemCount(int currentItemCount)
currentItemCount
- current indexAbstractItemCountingItemStreamItemReader.setCurrentItemCount(int)
public HibernateCursorItemReaderBuilder<T> parameterValues(java.util.Map<java.lang.String,java.lang.Object> parameterValues)
parameterValues
- map of valuesHibernateCursorItemReader.setParameterValues(Map)
public HibernateCursorItemReaderBuilder<T> queryName(java.lang.String queryName)
queryName
- name of the query to executeHibernateCursorItemReader.setQueryName(String)
public HibernateCursorItemReaderBuilder<T> fetchSize(int fetchSize)
fetchSize
- number of records to return per fetchHibernateCursorItemReader.setFetchSize(int)
public HibernateCursorItemReaderBuilder<T> queryProvider(HibernateQueryProvider<T> queryProvider)
queryString(String)
and
queryName(String)
have not been set.queryProvider
- the query providerHibernateCursorItemReader.setQueryProvider(HibernateQueryProvider)
public HibernateCursorItemReaderBuilder<T> queryString(java.lang.String queryString)
queryProvider(HibernateQueryProvider)
and queryName(String)
have
not been set.queryString
- the HQL queryHibernateCursorItemReader.setQueryString(String)
public HibernateCursorItemReaderBuilder<T> sessionFactory(org.hibernate.SessionFactory sessionFactory)
SessionFactory
to execute the query against.sessionFactory
- the session factoryHibernateCursorItemReader.setSessionFactory(SessionFactory)
public HibernateCursorItemReaderBuilder<T> useStatelessSession(boolean useStatelessSession)
StatelessSession
(true
) or a Session
(false
).useStatelessSession
- Defaults to falseHibernateCursorItemReader.setUseStatelessSession(boolean)
public HibernateCursorItemReaderBuilder<T> nativeQuery(java.lang.String nativeQuery)
HibernateNativeQueryProvider
. This is ignored ifnativeQuery
- String
containing the native query.public HibernateCursorItemReaderBuilder<T> entityClass(java.lang.Class<T> nativeClass)
public HibernateCursorItemReader<T> build()
HibernateCursorItemReader
.HibernateCursorItemReader