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 Details

    • CosmosConfigurationSupport

      public CosmosConfigurationSupport()
  • Method Details

    • 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