GigaSpaces XAP 9.5 API

org.openspaces.persistency.hibernate
Class CriteriaHibernateSpaceDataSourceFactoryBean

java.lang.Object
  extended by org.openspaces.persistency.hibernate.CriteriaHibernateSpaceDataSourceFactoryBean
All Implemented Interfaces:
FactoryBean<CriteriaHibernateSpaceDataSource>, InitializingBean

public class CriteriaHibernateSpaceDataSourceFactoryBean
extends Object
implements FactoryBean<CriteriaHibernateSpaceDataSource>, InitializingBean

A factory bean which creates CriteriaHibernateSpaceDataSource.

Since:
9.5
Author:
eitany

Constructor Summary
CriteriaHibernateSpaceDataSourceFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  CriteriaHibernateSpaceDataSourceConfigurer getConfigurer()
           
 CriteriaHibernateSpaceDataSource getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setFetchSize(int fetchSize)
          Sets the fetch size that will be used when working with scrollable results.
 void setInitialLoadChunkSize(int initalLoadChunkSize)
          By default, the initial load process will chunk large tables and will iterate over the table (entity) per chunk (concurrently).
 void setInitialLoadEntries(String... initialLoadEntries)
          Sets a list of entries that will be used to perform the #initialLoad() operation.
 void setInitialLoadThreadPoolSize(int initialLoadThreadPoolSize)
          The initial load operation uses the ConcurrentMultiDataIterator.
 void setManagedEntries(String... entries)
          Sets all the entries this Hibernate data source will work with.
 void setPerformOrderById(boolean performOrderById)
          When performing initial load, this flag indicates if the generated query will order to results by the id.
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
          Injects the Hibernate SessionFactory to be used with this data source.
 void setUseScrollableResultSet(boolean useScrollableResultSet)
          Controls if scrollable result sets will be used with initial load operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CriteriaHibernateSpaceDataSourceFactoryBean

public CriteriaHibernateSpaceDataSourceFactoryBean()
Method Detail

getConfigurer

protected CriteriaHibernateSpaceDataSourceConfigurer getConfigurer()

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Injects the Hibernate SessionFactory to be used with this data source.


setManagedEntries

public void setManagedEntries(String... entries)
Sets all the entries this Hibernate data source will work with. By default, will use Hibernate meta data API in order to get the list of all the given entities it handles.

This list is used to filter out entities when performing all data source operations exception for the #initialLoad() operation.

Usually, there is no need to explicitly set this.


setFetchSize

public void setFetchSize(int fetchSize)
Sets the fetch size that will be used when working with scrollable results. Defaults to 100.

See Also:
Criteria.setFetchSize(int)

setPerformOrderById

public void setPerformOrderById(boolean performOrderById)
When performing initial load, this flag indicates if the generated query will order to results by the id. By default set to true as it most times results in better initial load performance.


setInitialLoadEntries

public void setInitialLoadEntries(String... initialLoadEntries)
Sets a list of entries that will be used to perform the #initialLoad() operation. By default, will try and build a sensible list based on Hibernate meta data.

Note, sometimes an explicit list should be provided. For example, if we have a class A and class B, and A has a relationship to B which is not component. If in the space, we only wish to have A, and have B just as a field in A (and not as an Entry), then we need to explicitly set the list just to A. By default, if we won't set it, it will result in two entries existing in the Space, A and B, with A having a field of B as well.


setInitialLoadThreadPoolSize

public void setInitialLoadThreadPoolSize(int initialLoadThreadPoolSize)
The initial load operation uses the ConcurrentMultiDataIterator. This property allows to control the thread pool size of the concurrent multi data iterator. Defaults to 10.

Note, this usually will map one to one to the number of open connections / cursors against the database.


setInitialLoadChunkSize

public void setInitialLoadChunkSize(int initalLoadChunkSize)
By default, the initial load process will chunk large tables and will iterate over the table (entity) per chunk (concurrently). This setting allows to control the chunk size to split the table by. By default, set to 100,000. Batching can be disabled by setting -1.


setUseScrollableResultSet

public void setUseScrollableResultSet(boolean useScrollableResultSet)
Controls if scrollable result sets will be used with initial load operation. Defaults to true.


getObject

public CriteriaHibernateSpaceDataSource getObject()
                                           throws Exception
Specified by:
getObject in interface FactoryBean<CriteriaHibernateSpaceDataSource>
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean<CriteriaHibernateSpaceDataSource>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<CriteriaHibernateSpaceDataSource>

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

GigaSpaces XAP 9.5 API

Copyright © GigaSpaces.