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 newCoherenceRepositoryFactoryBeanfor the provided repository interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Ensure thatcoherenceis not null.protected org.springframework.data.repository.core.support.RepositoryFactorySupportcreateRepositoryFactory()First checks for the presence of theCoherenceMapannotation to find the name of the CoherenceNamedMapandSession.voidsetCoherence(com.tangosol.net.Coherence coherence)Configures theCoherenceinstance 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 theCoherenceMapannotation to find the name of the CoherenceNamedMapandSession. If the annotation is not present, then if the repository class name itself follows the format of [Entity-Type]Repository (e.g., BookRepository), then theNamedMapwill be looked up using the lower-case name of the entity type. Using theBookRepositoryexample, theNamedMapwould be resolved to book.- Specified by:
createRepositoryFactoryin classorg.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>- Returns:
- Throws:
IllegalStateException- if theNamedMapname cannot be resolved
-
setCoherence
public void setCoherence(com.tangosol.net.Coherence coherence)
Configures theCoherenceinstance to be used.- Parameters:
coherence- the Coherence instance to set
-
afterPropertiesSet
public void afterPropertiesSet()
Ensure thatcoherenceis not null.- Specified by:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>- See Also:
RepositoryFactoryBeanSupport.afterPropertiesSet()
-
-