Class CoherenceRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>
- java.lang.Object
-
- org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
-
- com.oracle.coherence.spring.data.support.CoherenceRepositoryFactoryBean<T,S,ID>
-
- Type Parameters:
ID
- the entity's identity typeT
- the repository typeS
- the entity type
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,FactoryBean<T>
,InitializingBean
,ApplicationEventPublisherAware
,org.springframework.data.repository.core.support.RepositoryFactoryInformation<S,ID>
public class CoherenceRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable> extends org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
Factory responsible for creating Repository instances for a specific repository interface.- Since:
- 3.0
- Author:
- Ryan Lubke, Gunnar Hillert
-
-
Field Summary
-
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description CoherenceRepositoryFactoryBean(Class<? extends T> repositoryInterface)
Constructs a newCoherenceRepositoryFactoryBean
for the provided repository interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Ensure thatcoherence
is not null.protected org.springframework.data.repository.core.support.RepositoryFactorySupport
createRepositoryFactory()
First checks for the presence of theCoherenceMap
annotation to find the name of the CoherenceNamedMap
andSession
.void
setCoherence(com.tangosol.net.Coherence coherence)
Configures theCoherence
instance to be used.-
Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport
addRepositoryFactoryCustomizer, createDefaultQueryMethodEvaluationContextProvider, getEntityInformation, getObject, getObjectType, getPersistentEntity, getQueryMethods, getRepositoryInformation, isSingleton, setApplicationEventPublisher, setBeanClassLoader, setBeanFactory, setCustomImplementation, setEvaluationContextProvider, setLazyInit, setMappingContext, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, setRepositoryFragments
-
-
-
-
Method Detail
-
createRepositoryFactory
protected org.springframework.data.repository.core.support.RepositoryFactorySupport createRepositoryFactory()
First checks for the presence of theCoherenceMap
annotation to find the name of the CoherenceNamedMap
andSession
. If the annotation is not present, then if the repository class name itself follows the format of [Entity-Type]Repository (e.g., BookRepository), then theNamedMap
will be looked up using the lower-case name of the entity type. Using theBookRepository
example, theNamedMap
would be resolved to book.- Specified by:
createRepositoryFactory
in classorg.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>
- Returns:
- Throws:
IllegalStateException
- if theNamedMap
name cannot be resolved
-
setCoherence
public void setCoherence(com.tangosol.net.Coherence coherence)
Configures theCoherence
instance to be used.- Parameters:
coherence
- the Coherence instance to set
-
afterPropertiesSet
public void afterPropertiesSet()
Ensure thatcoherence
is not null.- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Overrides:
afterPropertiesSet
in classorg.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>
- See Also:
RepositoryFactoryBeanSupport.afterPropertiesSet()
-
-