Class CouchbaseRepositoryFactory
java.lang.Object
org.springframework.data.repository.core.support.RepositoryFactorySupport
org.springframework.data.couchbase.repository.support.CouchbaseRepositoryFactory
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
Factory to create
SimpleCouchbaseRepository
instances.- Author:
- Michael Nitschinger, Simon Baslé, Oliver Gierke, Mark Paluch, Michael Reiche
-
Constructor Summary
ConstructorDescriptionCouchbaseRepositoryFactory
(RepositoryOperationsMapping couchbaseOperationsMapping) Create a new factory. -
Method Summary
Modifier and TypeMethodDescription<T,
ID> CouchbaseEntityInformation<T, ID> getEntityInformation
(Class<T> domainClass) Returns entity information based on the domain class.protected Optional<QueryLookupStrategy>
getQueryLookupStrategy
(QueryLookupStrategy.Key key, QueryMethodEvaluationContextProvider contextProvider) protected final Class<?>
getRepositoryBaseClass
(RepositoryMetadata repositoryMetadata) Returns the base class for the repository being constructed.getRepositoryFragments
(RepositoryMetadata metadata) getRepositoryFragments
(RepositoryMetadata metadata, CouchbaseOperations operations) CreatesRepositoryComposition.RepositoryFragments
based onRepositoryMetadata
to add Couchbase-specific extensions.protected Object
getTargetRepository
(RepositoryInformation metadata) Returns a new Repository based on the metadata.void
setBeanClassLoader
(ClassLoader classLoader) Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactorySupport
addInvocationListener, addQueryCreationListener, addRepositoryProxyPostProcessor, getProjectionFactory, getProjectionFactory, getQueryMethods, getRepository, getRepository, getRepository, getRepositoryInformation, getRepositoryMetadata, getTargetRepositoryViaReflection, getTargetRepositoryViaReflection, instantiateClass, setBeanFactory, setEvaluationContextProvider, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, validate
-
Constructor Details
-
CouchbaseRepositoryFactory
Create a new factory.- Parameters:
couchbaseOperationsMapping
- the template for the underlying actions.
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceBeanClassLoaderAware
- Overrides:
setBeanClassLoader
in classRepositoryFactorySupport
-
getEntityInformation
Returns entity information based on the domain class.- Specified by:
getEntityInformation
in classRepositoryFactorySupport
- Type Parameters:
T
- the value typeID
- the id type.- Parameters:
domainClass
- the class for the entity.- Returns:
- entity information for that domain class.
-
getTargetRepository
Returns a new Repository based on the metadata. Two categories of repositories can be instantiated:SimpleCouchbaseRepository
. This method performs feature checks to decide which of the two categories can be instantiated (eg. is N1QL available?). Instantiation is done via reflection, seegetRepositoryBaseClass(RepositoryMetadata)
.- Specified by:
getTargetRepository
in classRepositoryFactorySupport
- Parameters:
metadata
- the repository metadata.- Returns:
- a new created repository.
-
getRepositoryBaseClass
Returns the base class for the repository being constructed. We always return Override these methods if you want to change the base class for all your repositories.- Specified by:
getRepositoryBaseClass
in classRepositoryFactorySupport
- Parameters:
repositoryMetadata
- metadata for the repository.- Returns:
- the base class.
-
getQueryLookupStrategy
protected Optional<QueryLookupStrategy> getQueryLookupStrategy(QueryLookupStrategy.Key key, QueryMethodEvaluationContextProvider contextProvider) - Overrides:
getQueryLookupStrategy
in classRepositoryFactorySupport
-
getRepositoryFragments
protected RepositoryComposition.RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) - Overrides:
getRepositoryFragments
in classRepositoryFactorySupport
-
getRepositoryFragments
protected RepositoryComposition.RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata, CouchbaseOperations operations) CreatesRepositoryComposition.RepositoryFragments
based onRepositoryMetadata
to add Couchbase-specific extensions. Typically adds aQuerydslCouchbasePredicateExecutor
if the repository interface uses Querydsl.Can be overridden by subclasses to customize
RepositoryComposition.RepositoryFragments
.- Parameters:
metadata
- repository metadata.operations
- the Couchbase operations manager.- Returns:
-