public class CouchbaseRepositoryFactory
extends org.springframework.data.repository.core.support.RepositoryFactorySupport
SimpleCouchbaseRepository
instances.Constructor and Description |
---|
CouchbaseRepositoryFactory(RepositoryOperationsMapping couchbaseOperationsMapping,
IndexManager indexManager)
Create a new factory.
|
Modifier and Type | Method and Description |
---|---|
<T,ID extends Serializable> |
getEntityInformation(Class<T> domainClass)
Returns entity information based on the domain class.
|
protected Class<? extends N1qlCouchbaseRepository> |
getN1qlBaseClass(org.springframework.data.repository.core.RepositoryMetadata repositoryMetadata) |
protected org.springframework.data.repository.query.QueryLookupStrategy |
getQueryLookupStrategy(org.springframework.data.repository.query.QueryLookupStrategy.Key key,
org.springframework.data.repository.query.EvaluationContextProvider contextProvider) |
protected Class<?> |
getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata repositoryMetadata)
Returns the base class for the repository being constructed.
|
protected Class<? extends SimpleCouchbaseRepository> |
getSimpleBaseClass(org.springframework.data.repository.core.RepositoryMetadata repositoryMetadata) |
protected Object |
getTargetRepository(org.springframework.data.repository.core.RepositoryInformation metadata)
Returns a new Repository based on the metadata.
|
addQueryCreationListener, addRepositoryProxyPostProcessor, getQueryLookupStrategy, getQueryMethods, getRepository, getRepository, getRepositoryInformation, getRepositoryMetadata, getTargetRepositoryViaReflection, setBeanClassLoader, setBeanFactory, setEvaluationContextProvider, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, validate
public CouchbaseRepositoryFactory(RepositoryOperationsMapping couchbaseOperationsMapping, IndexManager indexManager)
couchbaseOperationsMapping
- the template for the underlying actions.public <T,ID extends Serializable> CouchbaseEntityInformation<T,ID> getEntityInformation(Class<T> domainClass)
getEntityInformation
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
T
- the value typeID
- the id type.domainClass
- the class for the entity.protected final Object getTargetRepository(org.springframework.data.repository.core.RepositoryInformation metadata)
SimpleCouchbaseRepository
and N1qlCouchbaseRepository
.
This method performs feature checks to decide which of the two categories can be instantiated (eg. is N1QL available?).
Instantiation is done via reflection, see getRepositoryBaseClass(RepositoryMetadata)
.getTargetRepository
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
metadata
- the repository metadata.protected final Class<?> getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata repositoryMetadata)
SimpleCouchbaseRepository
and N1qlCouchbaseRepository
. This method checks if N1QL
is available to choose between the two, but the actual concrete class is determined respectively by
getSimpleBaseClass(RepositoryMetadata)
and getN1qlBaseClass(RepositoryMetadata)
.
Override these methods if you want to change the base class for all your repositories.getRepositoryBaseClass
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
repositoryMetadata
- metadata for the repository.protected Class<? extends N1qlCouchbaseRepository> getN1qlBaseClass(org.springframework.data.repository.core.RepositoryMetadata repositoryMetadata)
protected Class<? extends SimpleCouchbaseRepository> getSimpleBaseClass(org.springframework.data.repository.core.RepositoryMetadata repositoryMetadata)
protected org.springframework.data.repository.query.QueryLookupStrategy getQueryLookupStrategy(org.springframework.data.repository.query.QueryLookupStrategy.Key key, org.springframework.data.repository.query.EvaluationContextProvider contextProvider)
getQueryLookupStrategy
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.