|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openspaces.persistency.hibernate.AbstractHibernateExternalDataSource org.openspaces.persistency.hibernate.DefaultHibernateExternalDataSource
public class DefaultHibernateExternalDataSource
The default Hibernate external data source implementation. Based on Hibernate Session
.
Field Summary |
---|
Fields inherited from class org.openspaces.persistency.hibernate.AbstractHibernateExternalDataSource |
---|
HIBERNATE_CFG_PROPERTY, logger |
Fields inherited from interface com.gigaspaces.datasource.ManagedDataSource |
---|
DATA_CLASS_PROPS, NUMBER_OF_PARTITIONS, STATIC_PARTITION_NUMBER |
Constructor Summary | |
---|---|
DefaultHibernateExternalDataSource()
|
Method Summary | |
---|---|
void |
executeBulk(List<BulkItem> bulkItems)
Perform the given bulk changes using Hibernate Session . |
protected Serializable |
getIdentifier(Object o)
Extracts and returns the hibernate object identifier |
DataIterator |
initialLoad()
Performs the initial load operation. |
DataIterator |
iterator(SQLQuery sqlQuery)
Returns a DefaultListQueryDataIterator for the
given sql query. |
void |
setDeleteById(boolean deleteById)
If set to true the object will be deleted using only its id. |
void |
setUseMerge(boolean useMerge)
If set to true , will use Hibernate merge to perform the create/update, and will
merge before calling delete. |
Methods inherited from class org.openspaces.persistency.hibernate.AbstractHibernateExternalDataSource |
---|
createInitialLoadIterator, getFetchSize, getInitialLoadChunkSize, getInitialLoadEntries, getManagedEntries, getSessionFactory, init, isManagedEntry, isPerformOrderById, isUseScrollableResultSet, setFetchSize, setInitialLoadChunkSize, setInitialLoadEntries, setInitialLoadThreadPoolSize, setManagedEntries, setPerformOrderById, setSessionFactory, setUseScrollableResultSet, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.gigaspaces.datasource.ManagedDataSource |
---|
init, shutdown |
Constructor Detail |
---|
public DefaultHibernateExternalDataSource()
Method Detail |
---|
public void setUseMerge(boolean useMerge)
true
, will use Hibernate merge
to perform the create/update, and will
merge before calling delete. This might be required for complex mappings (depends on Hibernate) at the
expense of slower performance. Defaults to false
.
public void setDeleteById(boolean deleteById)
true
the object will be deleted using only its id.
If set to false
the object will be deleted using the whole object.
Defaults to true
.
deleteById
- public void executeBulk(List<BulkItem> bulkItems) throws DataSourceException
Session
.
Note, this implementation relies on Hibernate NonUniqueObjectException
in case
the entity is already associated with the given session, and in such a case, will result in performing
merge operation (which is more expensive).
executeBulk
in interface BulkDataPersister
bulkItems
- list of data object and the operation to apply on that object
DataSourceException
- when the data store fails to persist the given list of objectspublic DataIterator iterator(SQLQuery sqlQuery) throws DataSourceException
DefaultListQueryDataIterator
for the
given sql query.
iterator
in interface SQLDataProvider
DataIterator
or null if no data was found that match the given template
DataSourceException
public DataIterator initialLoad() throws DataSourceException
AbstractHibernateExternalDataSource.setInitialLoadEntries(String[])
initial load
entries. If AbstractHibernateExternalDataSource.getInitialLoadChunkSize()
is set to -1
, will use
DefaultScrollableDataIterator
for each entity. If
AbstractHibernateExternalDataSource.getInitialLoadChunkSize()
is set to a non -1
value, will use the
DefaultChunkScrollableDataIterator
.
initialLoad
in interface ManagedDataSource
DataIterator
or null if no data should be loaded into space
DataSourceException
protected Serializable getIdentifier(Object o)
o
-
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |