Class MongoRepositoryFactoryBean<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>
org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean<T,S,ID>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.FactoryBean<T>,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationEventPublisherAware,org.springframework.data.repository.core.support.RepositoryFactoryInformation<S,ID>
public class MongoRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>
extends org.springframework.data.repository.core.support.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
ConstructorsConstructorDescriptionMongoRepositoryFactoryBean(Class<? extends T> repositoryInterface) Creates a newMongoRepositoryFactoryBeanfor the given repository interface. -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected org.springframework.data.repository.core.support.RepositoryFactorySupportprotected org.springframework.data.repository.core.support.RepositoryFactorySupportgetFactoryInstance(MongoOperations operations) Creates and initializes aRepositoryFactorySupportinstance.voidsetCreateIndexesForQueryMethods(boolean createIndexesForQueryMethods) Configures whether to automatically create indexes for the properties referenced in a query method.voidsetMappingContext(org.springframework.data.mapping.context.MappingContext<?, ?> mappingContext) voidsetMongoOperations(MongoOperations operations) Configures theMongoOperationsto 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 newMongoRepositoryFactoryBeanfor the given repository interface.- Parameters:
repositoryInterface- must not be null.
-
-
Method Details
-
setMongoOperations
Configures theMongoOperationsto 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
public void setMappingContext(org.springframework.data.mapping.context.MappingContext<?, ?> mappingContext) -
createRepositoryFactory
protected org.springframework.data.repository.core.support.RepositoryFactorySupport createRepositoryFactory() -
getFactoryInstance
protected org.springframework.data.repository.core.support.RepositoryFactorySupport getFactoryInstance(MongoOperations operations) Creates and initializes aRepositoryFactorySupportinstance.- Parameters:
operations-- Returns:
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,ID>, S, ID extends Serializable>
-