你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CosmosConfigurationSupport Class

  • java.lang.Object
    • com.azure.spring.data.cosmos.config.CosmosConfigurationSupport

public abstract class CosmosConfigurationSupport

A support class for cosmos configuration to scan beans and get initial entities

Constructor Summary

Constructor Description
CosmosConfigurationSupport()

Creates an instance of CosmosConfigurationSupport.

Method Summary

Modifier and Type Method and Description
CosmosMappingContext cosmosMappingContext()

Declare CosmosMappingContext bean.

ExpressionResolver expressionResolver(BeanFactory beanFactory)

Declare ExpressionResolver bean.

protected abstract String getDatabaseName()

Return the name of the database to connect to

protected Set<Class<?>> getInitialEntitySet()

Scan all base packages and get all beans

protected Collection<String> getMappingBasePackages()

Get the mapping base package name.

protected Set<Class<?>> scanForEntities(String basePackage)

Scan all beans under the given base package

Methods inherited from java.lang.Object

Constructor Details

CosmosConfigurationSupport

public CosmosConfigurationSupport()

Creates an instance of CosmosConfigurationSupport.

Method Details

cosmosMappingContext

public CosmosMappingContext cosmosMappingContext()

Declare CosmosMappingContext bean.

Returns:

CosmosMappingContext bean

Throws:

ClassNotFoundException

- if the class type is invalid

expressionResolver

public ExpressionResolver expressionResolver(BeanFactory beanFactory)

Declare ExpressionResolver bean.

Parameters:

beanFactory - used to initialize the embeddedValueResolver

Returns:

ExpressionResolver bean

getDatabaseName

protected abstract String getDatabaseName()

Return the name of the database to connect to

Returns:

must not be null.

getInitialEntitySet

protected Set> getInitialEntitySet()

Scan all base packages and get all beans

Returns:

initial entity set

Throws:

ClassNotFoundException

- if the class type is invalid

getMappingBasePackages

protected Collection getMappingBasePackages()

Get the mapping base package name.

Returns:

Base mapping package name set.

scanForEntities

protected Set> scanForEntities(String basePackage)

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

Applies to