public class CriteriaHibernateSpaceDataSourceFactoryBean extends Object implements FactoryBean<CriteriaHibernateSpaceDataSource>, InitializingBean, ClusterInfoAware
CriteriaHibernateSpaceDataSource
.Constructor and Description |
---|
CriteriaHibernateSpaceDataSourceFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected CriteriaHibernateSpaceDataSourceConfigurer |
getConfigurer() |
CriteriaHibernateSpaceDataSource |
getObject() |
Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setAugmentInitialLoadEntries(boolean augmentInitialLoadEntries)
Feature switch for initial load entries augmentation (creation of partition-specific query for entries).
|
void |
setClusterInfo(ClusterInfo clusterInfo)
Sets the cluster information.
|
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 |
setInitialLoadQueryScanningBasePackages(String... initialLoadQueryScanningBasePackages) |
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.
|
public CriteriaHibernateSpaceDataSourceFactoryBean()
protected CriteriaHibernateSpaceDataSourceConfigurer getConfigurer()
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
public void setManagedEntries(String... entries)
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.
public void setFetchSize(int fetchSize)
100
.Criteria.setFetchSize(int)
public void setPerformOrderById(boolean performOrderById)
true
as it most times results in better initial load performance.public void setInitialLoadEntries(String... initialLoadEntries)
#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.
public void setInitialLoadThreadPoolSize(int initialLoadThreadPoolSize)
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.
public void setInitialLoadChunkSize(int initalLoadChunkSize)
100,000
. Batching can be disabled by setting -1
.public void setUseScrollableResultSet(boolean useScrollableResultSet)
true
.public void setInitialLoadQueryScanningBasePackages(String... initialLoadQueryScanningBasePackages)
public void setClusterInfo(ClusterInfo clusterInfo)
ClusterInfoAware
Note, the cluster information is obtained externally from the application context which means
that this feature need to be supported by specific containers (and is not supported by plain
Spring application context). This means that beans that implement ClusterInfoAware
should take into account the fact that the cluster info provided might be null.
setClusterInfo
in interface ClusterInfoAware
clusterInfo
- The cluster information to be injectedCriteriaHibernateSpaceDataSourceConfigurer.clusterInfo(org.openspaces.core.cluster.ClusterInfo)
public void setAugmentInitialLoadEntries(boolean augmentInitialLoadEntries)
true
.public CriteriaHibernateSpaceDataSource getObject() throws Exception
getObject
in interface FactoryBean<CriteriaHibernateSpaceDataSource>
Exception
public Class<?> getObjectType()
getObjectType
in interface FactoryBean<CriteriaHibernateSpaceDataSource>
public boolean isSingleton()
isSingleton
in interface FactoryBean<CriteriaHibernateSpaceDataSource>
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
Copyright © GigaSpaces.