Class CosmosConfigurationSupport
- java.lang.Object
-
- com.azure.spring.data.cosmos.config.CosmosConfigurationSupport
-
- Direct Known Subclasses:
AbstractCosmosConfiguration
public abstract class CosmosConfigurationSupport extends Object
A support class for cosmos configuration to scan beans and get initial entities
-
-
Constructor Summary
Constructors Constructor Description CosmosConfigurationSupport()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CosmosMappingContextcosmosMappingContext()Declare CosmosMappingContext bean.ExpressionResolverexpressionResolver(org.springframework.beans.factory.BeanFactory beanFactory)Declare ExpressionResolver bean.protected abstract StringgetDatabaseName()Return the name of the database to connect toprotected Set<Class<?>>getInitialEntitySet()Scan all base packages and get all beansprotected Collection<String>getMappingBasePackages()Get the mapping base package name.protected Set<Class<?>>scanForEntities(String basePackage)Scan all beans under the given base package
-
-
-
Method Detail
-
getDatabaseName
protected abstract String getDatabaseName()
Return the name of the database to connect to- Returns:
- must not be null.
-
expressionResolver
@Bean public ExpressionResolver expressionResolver(org.springframework.beans.factory.BeanFactory beanFactory)
Declare ExpressionResolver bean.- Parameters:
beanFactory- used to initialize the embeddedValueResolver- Returns:
- ExpressionResolver bean
-
cosmosMappingContext
@Bean public CosmosMappingContext cosmosMappingContext() throws ClassNotFoundException
Declare CosmosMappingContext bean.- Returns:
- CosmosMappingContext bean
- Throws:
ClassNotFoundException- if the class type is invalid
-
getMappingBasePackages
protected Collection<String> getMappingBasePackages()
Get the mapping base package name.- Returns:
- Base mapping package name set.
-
getInitialEntitySet
protected Set<Class<?>> getInitialEntitySet() throws ClassNotFoundException
Scan all base packages and get all beans- Returns:
- initial entity set
- Throws:
ClassNotFoundException- if the class type is invalid
-
scanForEntities
protected Set<Class<?>> scanForEntities(String basePackage) throws ClassNotFoundException
Scan all beans under the given base package- Parameters:
basePackage- set the base location of beans- Returns:
- initial entity set for found beans
- Throws:
ClassNotFoundException- if the class type is invalid
-
-