GigaSpaces XAP 7.0 API

org.openspaces.persistency.hibernate
Class CriteriaHibernateExternalDataSource

java.lang.Object
  extended by org.openspaces.persistency.hibernate.AbstractHibernateExternalDataSource
      extended by org.openspaces.persistency.hibernate.DefaultHibernateExternalDataSource
          extended by org.openspaces.persistency.hibernate.CriteriaHibernateExternalDataSource
All Implemented Interfaces:
BulkDataPersister, DataProvider, ManagedDataSource, SQLDataProvider, ManagedDataSourceEntriesProvider

public class CriteriaHibernateExternalDataSource
extends DefaultHibernateExternalDataSource
implements DataProvider

An extension over the default implemenation that also implements DataProvider (not needed by default). The class main use is to override Hibernate bugs whene executing queries with composite objects.

Author:
kimchy

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
CriteriaHibernateExternalDataSource()
           
 
Method Summary
protected  Object getId(Object template)
          Return pojo identifier
protected  org.hibernate.metadata.ClassMetadata getMetadata(Object entry)
          Return pojo entry metadata
 DataIterator iterator(Object template)
          Create an iterator over all objects that match the given template.
 Object read(Object template)
          Read one object that matches the given template.
 
Methods inherited from class org.openspaces.persistency.hibernate.DefaultHibernateExternalDataSource
executeBulk, getIdentifier, initialLoad, iterator, setDeleteById, setUseMerge
 
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, initialLoad, shutdown
 

Constructor Detail

CriteriaHibernateExternalDataSource

public CriteriaHibernateExternalDataSource()
Method Detail

read

public Object read(Object template)
            throws DataSourceException
Description copied from interface: DataProvider
Read one object that matches the given template.
Used by the space for read templates with UID.

Specified by:
read in interface DataProvider
Returns:
matched object or null
Throws:
DataSourceException

iterator

public DataIterator iterator(Object template)
                      throws DataSourceException
Description copied from interface: DataProvider
Create an iterator over all objects that match the given template.
Note: null value can be passed - in case of a null template or at initial space load. If SQLDataProvider interface is also implemented - the space will use SQLDataProvider.iterator instead.

Specified by:
iterator in interface DataProvider
Returns:
a DataIterator or null if no data was found that match the given template
Throws:
DataSourceException

getId

protected Object getId(Object template)
Return pojo identifier


getMetadata

protected org.hibernate.metadata.ClassMetadata getMetadata(Object entry)
Return pojo entry metadata


GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.