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
ConstructorDescriptionMongoRepositoryFactory
(MongoOperations mongoOperations) Creates a newMongoRepositoryFactory
with the givenMongoOperations
. -
Method Summary
Modifier and TypeMethodDescription<T,
ID> MongoEntityInformation<T, ID> getEntityInformation
(Class<T> domainClass) protected ProjectionFactory
getProjectionFactory
(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.RepositoryFragments
based onRepositoryMetadata
to add Mongo-specific extensions.protected Object
getTargetRepository
(RepositoryInformation information) void
setBeanClassLoader
(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 newMongoRepositoryFactory
with the givenMongoOperations
.- Parameters:
mongoOperations
- must not be null.
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceBeanClassLoaderAware
- Overrides:
setBeanClassLoader
in classRepositoryFactorySupport
-
getProjectionFactory
- Overrides:
getProjectionFactory
in classRepositoryFactorySupport
-
getRepositoryBaseClass
- Specified by:
getRepositoryBaseClass
in classRepositoryFactorySupport
-
getRepositoryFragments
protected RepositoryComposition.RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) - Overrides:
getRepositoryFragments
in classRepositoryFactorySupport
-
getRepositoryFragments
protected RepositoryComposition.RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata, MongoOperations operations) CreatesRepositoryComposition.RepositoryFragments
based onRepositoryMetadata
to add Mongo-specific extensions. Typically adds aQuerydslMongoPredicateExecutor
if 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:
getTargetRepository
in classRepositoryFactorySupport
-
getQueryLookupStrategy
protected Optional<QueryLookupStrategy> getQueryLookupStrategy(@Nullable QueryLookupStrategy.Key key, QueryMethodEvaluationContextProvider evaluationContextProvider) - Overrides:
getQueryLookupStrategy
in classRepositoryFactorySupport
-
getEntityInformation
- Specified by:
getEntityInformation
in classRepositoryFactorySupport
-