org.compass.gps.device.hibernate.dep
Class Hibernate2GpsDevice

java.lang.Object
  extended by org.compass.gps.device.AbstractGpsDevice
      extended by org.compass.gps.device.support.parallel.AbstractParallelGpsDevice
          extended by org.compass.gps.device.hibernate.dep.AbstractHibernateGpsDevice
              extended by org.compass.gps.device.hibernate.dep.Hibernate2GpsDevice
All Implemented Interfaces:
CompassGpsDevice

public class Hibernate2GpsDevice
extends AbstractHibernateGpsDevice

A HibernateGpsDevice which works with hibernate 2.

You must either set the Hibernate Configuration or the SessionFactory to be used by the device. Note that if the Configuration is supplied, when the device start is called, a new SessionFactory will be built.

Note: Only provides the index() operation. No real time index updated are performed since the Hiberante Interceptor provides null values for newly created objects with generated ids.

Author:
kimchy

Nested Class Summary
 
Nested classes/interfaces inherited from class org.compass.gps.device.hibernate.dep.AbstractHibernateGpsDevice
AbstractHibernateGpsDevice.HibernateSessionWrapper
 
Field Summary
 
Fields inherited from class org.compass.gps.device.hibernate.dep.AbstractHibernateGpsDevice
fetchCount
 
Fields inherited from class org.compass.gps.device.AbstractGpsDevice
compassGps, log
 
Constructor Summary
Hibernate2GpsDevice()
           
Hibernate2GpsDevice(String name, net.sf.hibernate.cfg.Configuration configuration)
           
Hibernate2GpsDevice(String name, net.sf.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
protected  HibernateEntityInfo[] doGetHibernateEntitiesInfo()
          Returns all the hibernate entity info.
protected  AbstractHibernateGpsDevice.HibernateSessionWrapper doGetHibernateSessionWrapper()
           
protected  List doGetObjects(HibernateEntityInfo info, int from, int count, AbstractHibernateGpsDevice.HibernateSessionWrapper sessionWrapper)
          Returns the data that maps to the given class info, paginated with from and count.
protected  void doStart()
          Derived devices can implement it in case of start event notification.
protected  void doStop()
          Derived devices can implement it in case of stop event notification.
 void setConfiguration(net.sf.hibernate.cfg.Configuration configuration)
           
 void setSessionFactory(net.sf.hibernate.SessionFactory sessionFactory)
           
 
Methods inherited from class org.compass.gps.device.hibernate.dep.AbstractHibernateGpsDevice
doGetIndexEntities, doGetIndexEntitiesIndexer, setFetchCount
 
Methods inherited from class org.compass.gps.device.support.parallel.AbstractParallelGpsDevice
doIndex, index, setIndexEntitiesPartitioner, setParallelIndexExecutor, start
 
Methods inherited from class org.compass.gps.device.AbstractGpsDevice
buildMessage, getGps, getName, injectGps, isFilteredForIndex, isPerformingIndexOperation, isRunning, setFilteredEntitiesForIndex, setName, shouldMirrorDataChanges, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hibernate2GpsDevice

public Hibernate2GpsDevice()

Hibernate2GpsDevice

public Hibernate2GpsDevice(String name,
                           net.sf.hibernate.SessionFactory sessionFactory)

Hibernate2GpsDevice

public Hibernate2GpsDevice(String name,
                           net.sf.hibernate.cfg.Configuration configuration)
Method Detail

setSessionFactory

public void setSessionFactory(net.sf.hibernate.SessionFactory sessionFactory)

setConfiguration

public void setConfiguration(net.sf.hibernate.cfg.Configuration configuration)

doStart

protected void doStart()
                throws CompassGpsException
Description copied from class: AbstractGpsDevice
Derived devices can implement it in case of start event notification.

Overrides:
doStart in class AbstractGpsDevice
Throws:
CompassGpsException

doStop

protected void doStop()
               throws CompassGpsException
Description copied from class: AbstractGpsDevice
Derived devices can implement it in case of stop event notification.

Overrides:
doStop in class AbstractGpsDevice
Throws:
CompassGpsException

doGetHibernateSessionWrapper

protected AbstractHibernateGpsDevice.HibernateSessionWrapper doGetHibernateSessionWrapper()
Specified by:
doGetHibernateSessionWrapper in class AbstractHibernateGpsDevice

doGetHibernateEntitiesInfo

protected HibernateEntityInfo[] doGetHibernateEntitiesInfo()
                                                    throws HibernateGpsDeviceException
Description copied from class: AbstractHibernateGpsDevice
Returns all the hibernate entity info. Called when the device starts up.

Specified by:
doGetHibernateEntitiesInfo in class AbstractHibernateGpsDevice
Returns:
Hibernate class informtion
Throws:
HibernateGpsDeviceException

doGetObjects

protected List doGetObjects(HibernateEntityInfo info,
                            int from,
                            int count,
                            AbstractHibernateGpsDevice.HibernateSessionWrapper sessionWrapper)
                     throws HibernateGpsDeviceException
Description copied from class: AbstractHibernateGpsDevice
Returns the data that maps to the given class info, paginated with from and count.

Specified by:
doGetObjects in class AbstractHibernateGpsDevice
Throws:
HibernateGpsDeviceException


Copyright (c) 2004-2008 The Compass Project.