Class MongoRepositoryFactoryBean<T extends Repository<S,ID>,S,ID extends Serializable>
java.lang.Object
org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean<T,S,ID>
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,FactoryBean<T>
,InitializingBean
,ApplicationEventPublisherAware
,RepositoryFactoryInformation<S,
ID>
public class MongoRepositoryFactoryBean<T extends Repository<S,ID>,S,ID extends Serializable>
extends RepositoryFactoryBeanSupport<T,S,ID>
FactoryBean
to create MongoRepository
instances.- Author:
- Oliver Gierke
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
ConstructorDescriptionMongoRepositoryFactoryBean
(Class<? extends T> repositoryInterface) Creates a newMongoRepositoryFactoryBean
for the given repository interface. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected RepositoryFactorySupport
protected RepositoryFactorySupport
getFactoryInstance
(MongoOperations operations) Creates and initializes aRepositoryFactorySupport
instance.void
setCreateIndexesForQueryMethods
(boolean createIndexesForQueryMethods) Configures whether to automatically create indexes for the properties referenced in a query method.void
setMappingContext
(MappingContext<?, ?> mappingContext) void
setMongoOperations
(MongoOperations operations) Configures theMongoOperations
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, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, setRepositoryFragments
-
Constructor Details
-
MongoRepositoryFactoryBean
Creates a newMongoRepositoryFactoryBean
for the given repository interface.- Parameters:
repositoryInterface
- must not be null.
-
-
Method Details
-
setMongoOperations
Configures theMongoOperations
to be used.- Parameters:
operations
- the operations to set
-
setCreateIndexesForQueryMethods
public void setCreateIndexesForQueryMethods(boolean createIndexesForQueryMethods) Configures whether to automatically create indexes for the properties referenced in a query method.- Parameters:
createIndexesForQueryMethods
- the createIndexesForQueryMethods to set
-
setMappingContext
- Overrides:
setMappingContext
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID extends Serializable>
-
createRepositoryFactory
- Specified by:
createRepositoryFactory
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID extends Serializable>
-
getFactoryInstance
Creates and initializes aRepositoryFactorySupport
instance.- Parameters:
operations
-- Returns:
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Overrides:
afterPropertiesSet
in classRepositoryFactoryBeanSupport<T extends Repository<S,
ID>, S, ID extends Serializable>
-