Module spring.data.mongodb
Class MongoRepositoryFactory
java.lang.Object
org.springframework.data.repository.core.support.RepositoryFactorySupport
org.springframework.data.mongodb.repository.support.MongoRepositoryFactory
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware
Factory to create
MongoRepository instances.- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionMongoRepositoryFactory(MongoOperations mongoOperations) Creates a newMongoRepositoryFactorywith the givenMongoOperations. -
Method Summary
Modifier and TypeMethodDescription<T,ID> MongoEntityInformation<T, ID> getEntityInformation(Class<T> domainClass) protected ProjectionFactorygetProjectionFactory(ClassLoader classLoader, BeanFactory beanFactory) protected Optional<QueryLookupStrategy>getQueryLookupStrategy(QueryLookupStrategy.Key key, QueryMethodEvaluationContextProvider evaluationContextProvider) protected Class<?>getRepositoryBaseClass(RepositoryMetadata metadata) getRepositoryFragments(RepositoryMetadata metadata) getRepositoryFragments(RepositoryMetadata metadata, MongoOperations operations) CreatesRepositoryComposition.RepositoryFragmentsbased onRepositoryMetadatato add Mongo-specific extensions.protected ObjectgetTargetRepository(RepositoryInformation information) voidsetBeanClassLoader(ClassLoader classLoader) Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactorySupport
addInvocationListener, addQueryCreationListener, addRepositoryProxyPostProcessor, getProjectionFactory, getQueryMethods, getRepository, getRepository, getRepository, getRepositoryInformation, getRepositoryMetadata, getTargetRepositoryViaReflection, getTargetRepositoryViaReflection, instantiateClass, setBeanFactory, setEvaluationContextProvider, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, validate
-
Constructor Details
-
MongoRepositoryFactory
Creates a newMongoRepositoryFactorywith the givenMongoOperations.- Parameters:
mongoOperations- must not be null.
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceBeanClassLoaderAware- Overrides:
setBeanClassLoaderin classRepositoryFactorySupport
-
getProjectionFactory
- Overrides:
getProjectionFactoryin classRepositoryFactorySupport
-
getRepositoryBaseClass
- Specified by:
getRepositoryBaseClassin classRepositoryFactorySupport
-
getRepositoryFragments
protected RepositoryComposition.RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) - Overrides:
getRepositoryFragmentsin classRepositoryFactorySupport
-
getRepositoryFragments
protected RepositoryComposition.RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata, MongoOperations operations) CreatesRepositoryComposition.RepositoryFragmentsbased onRepositoryMetadatato add Mongo-specific extensions. Typically adds aQuerydslMongoPredicateExecutorif the repository interface uses Querydsl.Can be overridden by subclasses to customize
RepositoryComposition.RepositoryFragments.- Parameters:
metadata- repository metadata.operations- the MongoDB operations manager.- Returns:
- Since:
- 3.2.1
-
getTargetRepository
- Specified by:
getTargetRepositoryin classRepositoryFactorySupport
-
getQueryLookupStrategy
protected Optional<QueryLookupStrategy> getQueryLookupStrategy(@Nullable QueryLookupStrategy.Key key, QueryMethodEvaluationContextProvider evaluationContextProvider) - Overrides:
getQueryLookupStrategyin classRepositoryFactorySupport
-
getEntityInformation
- Specified by:
getEntityInformationin classRepositoryFactorySupport
-