Class ReactiveRepositoryOperationsMapping
java.lang.Object
org.springframework.data.couchbase.repository.config.ReactiveRepositoryOperationsMapping
- Since:
- 3.0
- Author:
- Subhashni Balakrishnan
-
Constructor Summary
ConstructorsConstructorDescriptionReactiveRepositoryOperationsMapping(ReactiveCouchbaseOperations defaultOperations) Creates a new mapping, setting the default fallback to use by otherwise non mapped repositories. -
Method Summary
Modifier and TypeMethodDescriptionGet theMappingContextto use in repositories.map(Class<?> repositoryInterface, ReactiveCouchbaseOperations operations) Add a highest priority mapping that will associate a specific repository interface with a givenReactiveCouchbaseOperations.mapEntity(Class<?> entityClass, ReactiveCouchbaseOperations operations) Add a middle priority mapping that will associate any un-mapped repository that deals with the given domain type Class with a givenReactiveCouchbaseOperations.Given a repository interface and its domain type, resolves whichReactiveCouchbaseOperationsit should be backed with.setDefault(ReactiveCouchbaseOperations aDefault) Change the default reactive couchbase operations in an existing mapping.
-
Constructor Details
-
ReactiveRepositoryOperationsMapping
Creates a new mapping, setting the default fallback to use by otherwise non mapped repositories.- Parameters:
defaultOperations- the default fallback reactive couchbase operations.
-
-
Method Details
-
map
public ReactiveRepositoryOperationsMapping map(Class<?> repositoryInterface, ReactiveCouchbaseOperations operations) Add a highest priority mapping that will associate a specific repository interface with a givenReactiveCouchbaseOperations.- Parameters:
repositoryInterface- the repository interfaceClass.operations- the ReactiveCouchbaseOperations to use.- Returns:
- the mapping, for chaining.
-
mapEntity
public ReactiveRepositoryOperationsMapping mapEntity(Class<?> entityClass, ReactiveCouchbaseOperations operations) Add a middle priority mapping that will associate any un-mapped repository that deals with the given domain type Class with a givenReactiveCouchbaseOperations.- Parameters:
entityClass- the domain type'sClass.operations- the CouchbaseOperations to use.- Returns:
- the mapping, for chaining.
-
getDefault
- Returns:
- the configured default
ReactiveCouchbaseOperations.
-
setDefault
Change the default reactive couchbase operations in an existing mapping.- Parameters:
aDefault- the new default couchbase operations.- Returns:
- the mapping, for chaining.
-
getMappingContext
public MappingContext<? extends CouchbasePersistentEntity<?>,CouchbasePersistentProperty> getMappingContext()Get theMappingContextto use in repositories. It is extracted from the defaultReactiveCouchbaseOperations.- Returns:
- the mapping context.
-
resolve
Given a repository interface and its domain type, resolves whichReactiveCouchbaseOperationsit should be backed with. Starts by looking for a direct mapping to the interface, then a common mapping for the domain type, then falls back to the default CouchbaseOperations.- Parameters:
repositoryInterface- the repository's interface.domainType- the repository's domain type / entity.- Returns:
- the CouchbaseOperations to back the repository.
-