GigaSpaces XAP 7.0 API

org.openspaces.persistency.hibernate.iterator
Class DefaultScrollableDataIterator

java.lang.Object
  extended by org.openspaces.persistency.hibernate.iterator.AbstractScrollableDataIterator
      extended by org.openspaces.persistency.hibernate.iterator.DefaultScrollableDataIterator
All Implemented Interfaces:
DataIterator, Iterator

public class DefaultScrollableDataIterator
extends AbstractScrollableDataIterator

A default scrollable result iterator based on Hibernate Session.

Author:
kimchy

Field Summary
protected  org.hibernate.Session session
           
protected  org.hibernate.Transaction transaction
           
 
Fields inherited from class org.openspaces.persistency.hibernate.iterator.AbstractScrollableDataIterator
entityName, fetchSize, from, hQuery, perfromOrderById, sessionFactory, size, sqlQuery
 
Constructor Summary
DefaultScrollableDataIterator(SQLQuery sqlQuery, org.hibernate.SessionFactory sessionFactory, int fetchSize, boolean performOrderById)
          Constructs a scrollable iterator over the given GigaSpaces SQLQuery.
DefaultScrollableDataIterator(SQLQuery sqlQuery, org.hibernate.SessionFactory sessionFactory, int fetchSize, boolean performOrderById, int from, int size)
          Constructs a scrollable iterator over the given GigaSpaces SQLQuery.
DefaultScrollableDataIterator(String hQuery, org.hibernate.SessionFactory sessionFactory, int fetchSize)
          Constructs a scrollable iterator over the given hibernate query string.
DefaultScrollableDataIterator(String entityName, org.hibernate.SessionFactory sessionFactory, int fetchSize, boolean performOrderById)
          Constructs a scrollable iterator over the given entity name.
DefaultScrollableDataIterator(String entityName, org.hibernate.SessionFactory sessionFactory, int fetchSize, boolean performOrderById, int from, int size)
          Constructs a scrollable iterator over the given entity name.
DefaultScrollableDataIterator(String hQuery, org.hibernate.SessionFactory sessionFactory, int fetchSize, int from, int size)
          Constructs a scrollable iterator over the given hibernate query string.
 
Method Summary
protected  void clear()
           
protected  org.hibernate.ScrollableResults createCursor()
           
protected  void doClose()
           
 
Methods inherited from class org.openspaces.persistency.hibernate.iterator.AbstractScrollableDataIterator
close, hasNext, next, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected org.hibernate.Session session

transaction

protected org.hibernate.Transaction transaction
Constructor Detail

DefaultScrollableDataIterator

public DefaultScrollableDataIterator(String entityName,
                                     org.hibernate.SessionFactory sessionFactory,
                                     int fetchSize,
                                     boolean performOrderById)
Constructs a scrollable iterator over the given entity name.

Parameters:
entityName - The entity name to scroll over
sessionFactory - The session factory to use to construct the session
fetchSize - The fetch size of the scrollabale result set
performOrderById - Should the query perform order by id or not

DefaultScrollableDataIterator

public DefaultScrollableDataIterator(String entityName,
                                     org.hibernate.SessionFactory sessionFactory,
                                     int fetchSize,
                                     boolean performOrderById,
                                     int from,
                                     int size)
Constructs a scrollable iterator over the given entity name.

Parameters:
entityName - The entity name to scroll over
sessionFactory - The session factory to use to constrcut the session
fetchSize - The fetch size of the scrollable result set
performOrderById - Should the query perform order by id or not
from - The from index to scroll from
size - The size of data to scroll to

DefaultScrollableDataIterator

public DefaultScrollableDataIterator(SQLQuery sqlQuery,
                                     org.hibernate.SessionFactory sessionFactory,
                                     int fetchSize,
                                     boolean performOrderById)
Constructs a scrollable iterator over the given GigaSpaces SQLQuery.

Parameters:
sqlQuery - The SQLQuery to scroll over
sessionFactory - The session factory to use to construct the session
fetchSize - The fetch size of the scrollabale result set
performOrderById - Should the query perform order by id or not

DefaultScrollableDataIterator

public DefaultScrollableDataIterator(SQLQuery sqlQuery,
                                     org.hibernate.SessionFactory sessionFactory,
                                     int fetchSize,
                                     boolean performOrderById,
                                     int from,
                                     int size)
Constructs a scrollable iterator over the given GigaSpaces SQLQuery.

Parameters:
sqlQuery - The SQLQuery to scroll over
sessionFactory - The session factory to use to constrcut the session
fetchSize - The fetch size of the scrollable result set
performOrderById - Should the query perform order by id or not
from - The from index to scroll from
size - The size of data to scroll to

DefaultScrollableDataIterator

public DefaultScrollableDataIterator(String hQuery,
                                     org.hibernate.SessionFactory sessionFactory,
                                     int fetchSize)
Constructs a scrollable iterator over the given hibernate query string.

Parameters:
hQuery - The hiberante query string to scroll over
sessionFactory - The session factory to use to construct the session
fetchSize - The fetch size of the scrollabale result set

DefaultScrollableDataIterator

public DefaultScrollableDataIterator(String hQuery,
                                     org.hibernate.SessionFactory sessionFactory,
                                     int fetchSize,
                                     int from,
                                     int size)
Constructs a scrollable iterator over the given hibernate query string.

Parameters:
hQuery - The hiberante query string to scroll over
sessionFactory - The session factory to use to constrcut the session
fetchSize - The fetch size of the scrollable result set
from - The from index to scroll from
size - The size of data to scroll to
Method Detail

doClose

protected void doClose()
Specified by:
doClose in class AbstractScrollableDataIterator

clear

protected void clear()
Specified by:
clear in class AbstractScrollableDataIterator

createCursor

protected org.hibernate.ScrollableResults createCursor()
Specified by:
createCursor in class AbstractScrollableDataIterator

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.