Annotation Interface EnableRedisDocumentRepositories


@Target(TYPE) @Retention(RUNTIME) @Documented @Inherited @Import(RedisJSONRepositoriesRegistrar.class) @QueryCreatorType(value=RediSearchQueryCreator.class, repositoryQueryType=RediSearchQuery.class) public @interface EnableRedisDocumentRepositories
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    Type-safe alternative to basePackages() for specifying the packages to scan for annotated components.
    Base packages to scan for annotated components.
    boolean
    Configures whether nested repository-interfaces (e.g.
    org.springframework.data.redis.core.RedisKeyValueAdapter.EnableKeyspaceEvents
    Configure usage of KeyExpirationEventMessageListener.
    org.springframework.context.annotation.ComponentScan.Filter[]
    Specifies which types are not eligible for component scanning.
    org.springframework.context.annotation.ComponentScan.Filter[]
    Specifies which types are eligible for component scanning.
    Class<? extends org.springframework.data.redis.core.index.IndexConfiguration>
    Set up index patterns using simple configuration class.
    Class<? extends org.springframework.data.redis.core.convert.KeyspaceConfiguration>
    Set up keyspaces for specific types.
    Configure the notify-keyspace-events property if not already set.
    Configures the name of the KeyValueOperations bean to be used with the repositories detected.
    Configure the name of the RedisMessageListenerContainer bean to be used for keyspace event subscriptions.
    Configures the location of where to find the Spring Data named queries properties file.
    org.springframework.data.repository.query.QueryLookupStrategy.Key
    Returns the key of the QueryLookupStrategy to be used for lookup queries for query methods.
    Configures the bean name of the RedisOperations to be used.
    Configure the repository base class to be used to create repository proxies for this particular configuration.
    Returns the FactoryBean class to be used for each repository instance.
    Returns the postfix to be used when looking up custom repository implementations.
    org.springframework.data.redis.core.RedisKeyValueAdapter.ShadowCopy
    Configuration flag controlling storage of phantom keys (shadow copies) of expiring entities to read them later when publishing keyspace events.
    Alias for the basePackages() attribute.
  • Element Details

    • value

      @AliasFor("basePackages") String[] value
      Alias for the basePackages() attribute. Allows for more concise annotation declarations e.g.: @EnableRedisRepositories("org.my.pkg") instead of @EnableRedisRepositories(basePackages="org.my.pkg").
      Returns:
      basePackages
      Default:
      {}
    • basePackages

      @AliasFor("value") String[] basePackages
      Base packages to scan for annotated components. value() is an alias for (and mutually exclusive with) this attribute. Use basePackageClasses() for a type-safe alternative to String-based package names.
      Returns:
      basePackages as a String
      Default:
      {}
    • basePackageClasses

      Class<?>[] basePackageClasses
      Type-safe alternative to basePackages() for specifying the packages to scan for annotated components. The package of each class specified will be scanned. Consider creating a special no-op marker class or interface in each package that serves no purpose other than being referenced by this attribute.
      Returns:
      array of base Package Classes
      Default:
      {}
    • excludeFilters

      org.springframework.context.annotation.ComponentScan.Filter[] excludeFilters
      Specifies which types are not eligible for component scanning.
      Returns:
      array of components to exclude
      Default:
      {}
    • includeFilters

      org.springframework.context.annotation.ComponentScan.Filter[] includeFilters
      Specifies which types are eligible for component scanning. Further narrows the set of candidate components from everything in basePackages() to everything in the base packages that matches the given filter or filters.
      Returns:
      array of components to include
      Default:
      {}
    • repositoryImplementationPostfix

      String repositoryImplementationPostfix
      Returns the postfix to be used when looking up custom repository implementations. Defaults to Impl. So for a repository named PersonRepository the corresponding implementation class will be looked up scanning for PersonRepositoryImpl.
      Returns:
      postfix for the dynamically generated repository class
      Default:
      "Impl"
    • namedQueriesLocation

      String namedQueriesLocation
      Configures the location of where to find the Spring Data named queries properties file.
      Returns:
      named queries relative location
      Default:
      ""
    • queryLookupStrategy

      org.springframework.data.repository.query.QueryLookupStrategy.Key queryLookupStrategy
      Returns the key of the QueryLookupStrategy to be used for lookup queries for query methods. Defaults to QueryLookupStrategy.Key.CREATE_IF_NOT_FOUND.
      Returns:
      lookup strategy key
      Default:
      CREATE_IF_NOT_FOUND
    • repositoryFactoryBeanClass

      Class<?> repositoryFactoryBeanClass
      Returns the FactoryBean class to be used for each repository instance. Defaults to RedisRepositoryFactoryBean.
      Returns:
      repository factory bean class
      Default:
      com.redis.om.spring.repository.support.RedisDocumentRepositoryFactoryBean.class
    • repositoryBaseClass

      Class<?> repositoryBaseClass
      Configure the repository base class to be used to create repository proxies for this particular configuration.
      Returns:
      repository base class
      Default:
      org.springframework.data.repository.config.DefaultRepositoryBaseClass.class
    • keyValueTemplateRef

      String keyValueTemplateRef
      Configures the name of the KeyValueOperations bean to be used with the repositories detected.
      Returns:
      key value operations template name
      Default:
      "redisJSONKeyValueTemplate"
    • considerNestedRepositories

      boolean considerNestedRepositories
      Configures whether nested repository-interfaces (e.g. defined as inner classes) should be discovered by the repositories infrastructure.
      Returns:
      whether to consider nested repositories
      Default:
      false
    • redisTemplateRef

      String redisTemplateRef
      Configures the bean name of the RedisOperations to be used. Defaulted to redisTemplate.
      Returns:
      name of the ops template
      Default:
      "redisTemplate"
    • indexConfiguration

      Class<? extends org.springframework.data.redis.core.index.IndexConfiguration> indexConfiguration
      Set up index patterns using simple configuration class.
      Returns:
      index configuration class
      Default:
      org.springframework.data.redis.core.index.IndexConfiguration.class
    • keyspaceConfiguration

      Class<? extends org.springframework.data.redis.core.convert.KeyspaceConfiguration> keyspaceConfiguration
      Set up keyspaces for specific types.
      Returns:
      keyspace configuration
      Default:
      org.springframework.data.redis.core.convert.KeyspaceConfiguration.class
    • enableKeyspaceEvents

      org.springframework.data.redis.core.RedisKeyValueAdapter.EnableKeyspaceEvents enableKeyspaceEvents
      Configure usage of KeyExpirationEventMessageListener.
      Returns:
      whether to enable keyspace events
      Since:
      1.8
      Default:
      OFF
    • messageListenerContainerRef

      String messageListenerContainerRef
      Configure the name of the RedisMessageListenerContainer bean to be used for keyspace event subscriptions. Defaults to use an anonymous managed instance by RedisKeyValueAdapter.
      Returns:
      the messageListenerContainerRef
      Since:
      2.7.2
      Default:
      ""
    • shadowCopy

      org.springframework.data.redis.core.RedisKeyValueAdapter.ShadowCopy shadowCopy
      Configuration flag controlling storage of phantom keys (shadow copies) of expiring entities to read them later when publishing keyspace events.
      Returns:
      shadow copy
      Since:
      2.4
      Default:
      DEFAULT
    • keyspaceNotificationsConfigParameter

      String keyspaceNotificationsConfigParameter
      Configure the notify-keyspace-events property if not already set. Use an empty String to keep (not alter) existing server configuration.
      Returns:
      Ex by default.
      Since:
      1.8
      Default:
      "Ex"