Class GemfireDaoSupport
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.data.gemfire.dao.GemfireDaoSupport
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
public abstract class GemfireDaoSupport
extends org.springframework.dao.support.DaoSupport
Convenient super class for GemFire Data Access Objects (DAO) implementing the Spring
DaoSupport
abstract class. Intended for use with GemfireTemplate
.
Requires a GemFire Region
to be set, providing a GemfireTemplate
based on it to subclasses.
Can alternatively be initialized directly via a GemfireTemplate
reusing the template's settings.
This class will create its own GemfireTemplate
if a GemFire Region
reference is passed in.
A custom GemfireTemplate
instance can be used through overriding createGemfireTemplate
.- See Also:
-
Region
DaoSupport
GemfireTemplate
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
Verifies that this DAO has been configured properly.protected GemfireTemplate
createGemfireTemplate
(org.apache.geode.cache.Region<?, ?> region) Creates an instance of the GemfireTemplate for the given GemFire Cache Region.final GemfireOperations
Returns the GemfireTemplate for this DAO, pre-initialized with the Region or set explicitly.final void
setGemfireTemplate
(GemfireOperations gemfireTemplate) Set the GemfireTemplate for this DAO explicitly as an alternative to specifying a GemFire CacheRegion
.void
setRegion
(org.apache.geode.cache.Region<?, ?> region) Sets the GemFire Cache Region to be used by this DAO.Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
-
Constructor Details
-
GemfireDaoSupport
public GemfireDaoSupport()
-
-
Method Details
-
setGemfireTemplate
Set the GemfireTemplate for this DAO explicitly as an alternative to specifying a GemFire CacheRegion
.- Parameters:
gemfireTemplate
- the GemfireTemplate to be use by this DAO.- See Also:
-
getGemfireTemplate
Returns the GemfireTemplate for this DAO, pre-initialized with the Region or set explicitly.- Returns:
- an instance of the GemfireTemplate to perform data access operations on the GemFire Cache Region.
- See Also:
-
setRegion
public void setRegion(org.apache.geode.cache.Region<?, ?> region) Sets the GemFire Cache Region to be used by this DAO. Will automatically create an instance of the GemfireTemplate for the given Region.- Parameters:
region
- the GemFire Cache Region upon which this DAO operates.- See Also:
-
createGemfireTemplate
Creates an instance of the GemfireTemplate for the given GemFire Cache Region.Can be overridden in subclasses to provide a GemfireTemplate instance with different configuration, or even a custom GemfireTemplate subclass.
- Parameters:
region
- the GemFire Cache Region for which the GemfireTemplate is created.- Returns:
- a new GemfireTemplate instance configured with the given GemFire Cache Region.
- See Also:
-
checkDaoConfig
protected final void checkDaoConfig()Verifies that this DAO has been configured properly.- Specified by:
checkDaoConfig
in classorg.springframework.dao.support.DaoSupport
-