Class HibernateItemReaderHelper<T>
java.lang.Object
org.springframework.batch.item.database.HibernateItemReaderHelper<T>
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@Deprecated(since="5.0",
forRemoval=true)
public class HibernateItemReaderHelper<T>
extends Object
implements org.springframework.beans.factory.InitializingBean
Deprecated, for removal: This API element is subject to removal in a future version.
since 5.0 for removal in 5.2. Use the JPA item readers instead.
Internal shared state helper for hibernate readers managing sessions and queries.
- Author:
- Dave Syer, Mahmoud Ben Hassine, June Young. Park
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated, for removal: This API element is subject to removal in a future version.voidclear()Deprecated, for removal: This API element is subject to removal in a future version.Clear the session if stateful.voidclose()Deprecated, for removal: This API element is subject to removal in a future version.Close the open session (stateful or otherwise).org.hibernate.query.Query<? extends T>Deprecated, for removal: This API element is subject to removal in a future version.Open appropriate type of hibernate session and create the query.org.hibernate.ScrollableResults<? extends T>getForwardOnlyCursor(int fetchSize, Map<String, Object> parameterValues) Deprecated, for removal: This API element is subject to removal in a future version.Get a cursor over all of the results, with the forward-only flag set.voidjumpToItem(org.hibernate.ScrollableResults cursor, int itemIndex, int flushInterval) Deprecated, for removal: This API element is subject to removal in a future version.Scroll through the results up to the item specified.Collection<? extends T>Deprecated, for removal: This API element is subject to removal in a future version.Read a page of data, clearing the existing session (if necessary) first, and creating a new session before executing the query.voidsetQueryName(String queryName) Deprecated, for removal: This API element is subject to removal in a future version.voidsetQueryProvider(HibernateQueryProvider<? extends T> queryProvider) Deprecated, for removal: This API element is subject to removal in a future version.voidsetQueryString(String queryString) Deprecated, for removal: This API element is subject to removal in a future version.voidsetSessionFactory(org.hibernate.SessionFactory sessionFactory) Deprecated, for removal: This API element is subject to removal in a future version.voidsetUseStatelessSession(boolean useStatelessSession) Deprecated, for removal: This API element is subject to removal in a future version.Can be set only in uninitialized state.
-
Constructor Details
-
HibernateItemReaderHelper
public HibernateItemReaderHelper()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
setQueryName
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
queryName- name of a hibernate named query
-
setQueryString
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
queryString- HQL query string
-
setQueryProvider
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
queryProvider- Hibernate query provider
-
setUseStatelessSession
public void setUseStatelessSession(boolean useStatelessSession) Deprecated, for removal: This API element is subject to removal in a future version.Can be set only in uninitialized state.- Parameters:
useStatelessSession-trueto useStatelessSessionfalseto use standard hibernateSession
-
setSessionFactory
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
sessionFactory- hibernate session factory
-
afterPropertiesSet
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getForwardOnlyCursor
public org.hibernate.ScrollableResults<? extends T> getForwardOnlyCursor(int fetchSize, Map<String, Object> parameterValues) Deprecated, for removal: This API element is subject to removal in a future version.Get a cursor over all of the results, with the forward-only flag set.- Parameters:
fetchSize- the fetch size to use retrieving the resultsparameterValues- the parameter values to use (or null if none).- Returns:
- a forward-only
ScrollableResults
-
createQuery
Deprecated, for removal: This API element is subject to removal in a future version.Open appropriate type of hibernate session and create the query.- Returns:
- a Hibernate Query
-
jumpToItem
public void jumpToItem(org.hibernate.ScrollableResults cursor, int itemIndex, int flushInterval) Deprecated, for removal: This API element is subject to removal in a future version.Scroll through the results up to the item specified.- Parameters:
cursor- the results to scroll overitemIndex- index to scroll toflushInterval- the number of items to scroll past before flushing
-
close
public void close()Deprecated, for removal: This API element is subject to removal in a future version.Close the open session (stateful or otherwise). -
readPage
public Collection<? extends T> readPage(int page, int pageSize, int fetchSize, Map<String, Object> parameterValues) Deprecated, for removal: This API element is subject to removal in a future version.Read a page of data, clearing the existing session (if necessary) first, and creating a new session before executing the query.- Parameters:
page- the page to read (starting at 0)pageSize- the size of the page or maximum number of items to readfetchSize- the fetch size to useparameterValues- the parameter values to use (if any, otherwise null)- Returns:
- a collection of items
-
clear
public void clear()Deprecated, for removal: This API element is subject to removal in a future version.Clear the session if stateful.
-