org.compass.gps.device.hibernate
Class AbstractHibernateGpsDevice

java.lang.Object
  extended by org.compass.gps.device.AbstractGpsDevice
      extended by org.compass.gps.device.hibernate.AbstractHibernateGpsDevice
All Implemented Interfaces:
CompassGpsDevice, HibernateGpsDevice
Direct Known Subclasses:
Hibernate2GpsDevice, Hibernate3GpsDevice

public abstract class AbstractHibernateGpsDevice
extends AbstractGpsDevice
implements HibernateGpsDevice

An abstract hibernate device support. Aimed to provide the base operations required by both Hiberante 2 and Hibernate 3.

Author:
kimchy

Nested Class Summary
protected static class AbstractHibernateGpsDevice.HibernateClassInfo
           
protected static interface AbstractHibernateGpsDevice.HibernateSessionWrapper
           
 
Field Summary
protected  int fetchCount
           
 
Fields inherited from class org.compass.gps.device.AbstractGpsDevice
compassGps, log
 
Constructor Summary
AbstractHibernateGpsDevice()
           
 
Method Summary
protected abstract  AbstractHibernateGpsDevice.HibernateClassInfo[] doGetHibernateClassesInfo()
          Returns all the hibernate class info (the hibernate mapped classes and their count).
protected abstract  AbstractHibernateGpsDevice.HibernateSessionWrapper doGetHibernateSessionWrapper()
           
protected abstract  List doGetObjects(AbstractHibernateGpsDevice.HibernateClassInfo 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 doIndex(CompassSession session)
          Indexes all the data that has hibernate mapping and compass mapping associated with it.
protected  void doStart()
          Derived devices can implement it in case of start event notification.
 void setFetchCount(int fetchCount)
          The batch fetch count the should be used when fetching data from a hiberante mapped class.
 
Methods inherited from class org.compass.gps.device.AbstractGpsDevice
buildMessage, doStop, getGps, getName, index, isFilteredForIndex, isPerformingIndexOperation, isRunning, setFilteredEntitiesForIndex, setGps, setName, shouldMirrorDataChanges, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.compass.gps.device.hibernate.HibernateGpsDevice
setFilteredEntitiesForIndex
 
Methods inherited from interface org.compass.gps.CompassGpsDevice
getGps, getName, index, isPerformingIndexOperation, isRunning, setGps, setName, shouldMirrorDataChanges, start, stop
 

Field Detail

fetchCount

protected int fetchCount
Constructor Detail

AbstractHibernateGpsDevice

public AbstractHibernateGpsDevice()
Method Detail

setFetchCount

public void setFetchCount(int fetchCount)
Description copied from interface: HibernateGpsDevice
The batch fetch count the should be used when fetching data from a hiberante mapped class. Defaults to 200.

Specified by:
setFetchCount in interface HibernateGpsDevice

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

doIndex

protected void doIndex(CompassSession session)
                throws CompassException
Indexes all the data that has hibernate mapping and compass mapping associated with it.

Specified by:
doIndex in class AbstractGpsDevice
Throws:
CompassException

doGetHibernateClassesInfo

protected abstract AbstractHibernateGpsDevice.HibernateClassInfo[] doGetHibernateClassesInfo()
                                                                                      throws HibernateGpsDeviceException
Returns all the hibernate class info (the hibernate mapped classes and their count).

Returns:
Hibernate class informtion
Throws:
HibernateGpsDeviceException

doGetObjects

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

Throws:
HibernateGpsDeviceException

doGetHibernateSessionWrapper

protected abstract AbstractHibernateGpsDevice.HibernateSessionWrapper doGetHibernateSessionWrapper()


Copyright (c) 2004-2006 The Compass Project.