Class MongoRepositoryFactory
java.lang.Object
org.springframework.data.repository.core.support.RepositoryFactorySupport
org.springframework.data.mongodb.repository.support.MongoRepositoryFactory
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware
public class MongoRepositoryFactory
extends org.springframework.data.repository.core.support.RepositoryFactorySupport
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 org.springframework.data.projection.ProjectionFactorygetProjectionFactory(ClassLoader classLoader, org.springframework.beans.factory.BeanFactory beanFactory) protected Optional<org.springframework.data.repository.query.QueryLookupStrategy>getQueryLookupStrategy(org.springframework.data.repository.query.QueryLookupStrategy.Key key, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) protected Class<?>getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata metadata) protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragmentsgetRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata) protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragmentsgetRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata, MongoOperations operations) CreatesRepositoryComposition.RepositoryFragmentsbased onRepositoryMetadatato add Mongo-specific extensions.protected ObjectgetTargetRepository(org.springframework.data.repository.core.RepositoryInformation information) Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactorySupport
addInvocationListener, addQueryCreationListener, addRepositoryProxyPostProcessor, getProjectionFactory, getQueryMethods, getRepository, getRepository, getRepository, getRepositoryInformation, getRepositoryMetadata, getTargetRepositoryViaReflection, getTargetRepositoryViaReflection, instantiateClass, setBeanClassLoader, setBeanFactory, setEvaluationContextProvider, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, validate
-
Constructor Details
-
MongoRepositoryFactory
Creates a newMongoRepositoryFactorywith the givenMongoOperations.- Parameters:
mongoOperations- must not be null.
-
-
Method Details
-
getProjectionFactory
protected org.springframework.data.projection.ProjectionFactory getProjectionFactory(ClassLoader classLoader, org.springframework.beans.factory.BeanFactory beanFactory) - Overrides:
getProjectionFactoryin classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getRepositoryBaseClass
protected Class<?> getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata metadata) - Specified by:
getRepositoryBaseClassin classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getRepositoryFragments
protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata) - Overrides:
getRepositoryFragmentsin classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getRepositoryFragments
protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments getRepositoryFragments(org.springframework.data.repository.core.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
protected Object getTargetRepository(org.springframework.data.repository.core.RepositoryInformation information) - Specified by:
getTargetRepositoryin classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getQueryLookupStrategy
protected Optional<org.springframework.data.repository.query.QueryLookupStrategy> getQueryLookupStrategy(@Nullable org.springframework.data.repository.query.QueryLookupStrategy.Key key, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider) - Overrides:
getQueryLookupStrategyin classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getEntityInformation
- Specified by:
getEntityInformationin classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-