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,EnvironmentAware,EnvironmentCapable
Factory to create
SimpleCouchbaseRepository instances.- Author:
- Michael Nitschinger, Simon Baslé, Oliver Gierke, Mark Paluch, Michael Reiche
-
Constructor Summary
ConstructorsConstructorDescriptionCouchbaseRepositoryFactory(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.RepositoryFragmentsbased onRepositoryMetadatato add Couchbase-specific extensions.protected ObjectgetTargetRepository(RepositoryInformation metadata) Returns a new Repository based on the metadata.voidsetBeanClassLoader(ClassLoader classLoader) Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactorySupport
addInvocationListener, addQueryCreationListener, addRepositoryProxyPostProcessor, getEnvironment, getProjectionFactory, getProjectionFactory, getQueryLookupStrategy, getQueryMethods, getRepository, getRepository, getRepository, getRepositoryInformation, getRepositoryMetadata, getTargetRepositoryViaReflection, getTargetRepositoryViaReflection, instantiateClass, setBeanFactory, setEnvironment, setEvaluationContextProvider, setEvaluationContextProvider, setExposeMetadata, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, validate
-
Constructor Details
-
CouchbaseRepositoryFactory
Create a new factory.- Parameters:
couchbaseOperationsMapping- the template for the underlying actions.
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoaderin interfaceBeanClassLoaderAware- Overrides:
setBeanClassLoaderin classRepositoryFactorySupport
-
getEntityInformation
Returns entity information based on the domain class.- Specified by:
getEntityInformationin 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:
getTargetRepositoryin 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:
getRepositoryBaseClassin classRepositoryFactorySupport- Parameters:
repositoryMetadata- metadata for the repository.- Returns:
- the base class.
-
getQueryLookupStrategy
protected Optional<QueryLookupStrategy> getQueryLookupStrategy(QueryLookupStrategy.Key key, QueryMethodEvaluationContextProvider contextProvider) - Overrides:
getQueryLookupStrategyin classRepositoryFactorySupport
-
getRepositoryFragments
protected RepositoryComposition.RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) - Overrides:
getRepositoryFragmentsin classRepositoryFactorySupport
-
getRepositoryFragments
protected RepositoryComposition.RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata, CouchbaseOperations operations) CreatesRepositoryComposition.RepositoryFragmentsbased onRepositoryMetadatato add Couchbase-specific extensions. Typically adds aQuerydslCouchbasePredicateExecutorif the repository interface uses Querydsl.Can be overridden by subclasses to customize
RepositoryComposition.RepositoryFragments.- Parameters:
metadata- repository metadata.operations- the Couchbase operations manager.- Returns:
-