T
- the type of the repositorypublic abstract class RepositoryFactoryBeanSupport<T extends Repository<S,ID>,S,ID extends Serializable> extends Object implements InitializingBean, RepositoryFactoryInformation<S,ID>, FactoryBean<T>, BeanClassLoaderAware
FactoryBean
interface to allow easy setup of repository factories via Spring
configuration.Constructor and Description |
---|
RepositoryFactoryBeanSupport() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected abstract RepositoryFactorySupport |
createRepositoryFactory()
Create the actual
RepositoryFactorySupport instance. |
EntityInformation<S,ID> |
getEntityInformation()
Returns
EntityInformation the repository factory is using. |
T |
getObject() |
Class<? extends T> |
getObjectType() |
PersistentEntity<?,?> |
getPersistentEntity()
Returns the
PersistentEntity managed by the underlying repository. |
List<QueryMethod> |
getQueryMethods()
Returns all
QueryMethod s declared for that repository. |
RepositoryInformation |
getRepositoryInformation()
Returns the
RepositoryInformation to determine meta-information about the repository being used. |
boolean |
isSingleton() |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setCustomImplementation(Object customImplementation)
Setter to inject a custom repository implementation.
|
protected void |
setMappingContext(MappingContext<?,?> mappingContext)
Configures the
MappingContext to be used to lookup PersistentEntity instances for
getPersistentEntity() . |
void |
setNamedQueries(NamedQueries namedQueries)
Setter to inject a
NamedQueries instance. |
void |
setQueryLookupStrategyKey(QueryLookupStrategy.Key queryLookupStrategyKey)
Set the
QueryLookupStrategy.Key to be used. |
void |
setRepositoryInterface(Class<? extends T> repositoryInterface)
Setter to inject the repository interface to implement.
|
public void setRepositoryInterface(Class<? extends T> repositoryInterface)
repositoryInterface
- the repository interface to setpublic void setQueryLookupStrategyKey(QueryLookupStrategy.Key queryLookupStrategyKey)
QueryLookupStrategy.Key
to be used.queryLookupStrategyKey
- public void setCustomImplementation(Object customImplementation)
customImplementation
- public void setNamedQueries(NamedQueries namedQueries)
NamedQueries
instance.namedQueries
- the namedQueries to setprotected void setMappingContext(MappingContext<?,?> mappingContext)
MappingContext
to be used to lookup PersistentEntity
instances for
getPersistentEntity()
.mappingContext
- public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public EntityInformation<S,ID> getEntityInformation()
RepositoryFactoryInformation
EntityInformation
the repository factory is using.getEntityInformation
in interface RepositoryFactoryInformation<S,ID extends Serializable>
public RepositoryInformation getRepositoryInformation()
RepositoryFactoryInformation
RepositoryInformation
to determine meta-information about the repository being used.getRepositoryInformation
in interface RepositoryFactoryInformation<S,ID extends Serializable>
public PersistentEntity<?,?> getPersistentEntity()
RepositoryFactoryInformation
PersistentEntity
managed by the underlying repository. Can be null in case the
underlying persistence mechanism does not expose a MappingContext
.getPersistentEntity
in interface RepositoryFactoryInformation<S,ID extends Serializable>
public List<QueryMethod> getQueryMethods()
RepositoryFactoryInformation
QueryMethod
s declared for that repository.getQueryMethods
in interface RepositoryFactoryInformation<S,ID extends Serializable>
public T getObject()
getObject
in interface FactoryBean<T extends Repository<S,ID>>
public Class<? extends T> getObjectType()
getObjectType
in interface FactoryBean<T extends Repository<S,ID>>
public boolean isSingleton()
isSingleton
in interface FactoryBean<T extends Repository<S,ID>>
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
protected abstract RepositoryFactorySupport createRepositoryFactory()
RepositoryFactorySupport
instance.Copyright © 2011-2013-2014 Pivotal. All Rights Reserved.