Package com.redis.om.spring.annotations
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 ElementsModifier and TypeOptional ElementDescriptionClass<?>[]Type-safe alternative tobasePackages()for specifying the packages to scan for annotated components.String[]Base packages to scan for annotated components.booleanConfigures whether nested repository-interfaces (e.g.org.springframework.data.redis.core.RedisKeyValueAdapter.EnableKeyspaceEventsConfigure usage ofKeyExpirationEventMessageListener.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 theKeyValueOperationsbean to be used with the repositories detected.Configure the name of theRedisMessageListenerContainerbean 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.KeyReturns the key of theQueryLookupStrategyto be used for lookup queries for query methods.Configures the bean name of theRedisOperationsto be used.Class<?>Configure the repository base class to be used to create repository proxies for this particular configuration.Class<?>Returns theFactoryBeanclass 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.ShadowCopyConfiguration flag controlling storage of phantom keys (shadow copies) of expiring entities to read them later when publishingkeyspace events.String[]Alias for thebasePackages()attribute.
-
Element Details
-
value
Alias for thebasePackages()attribute. Allows for more concise annotation declarations e.g.:@EnableRedisRepositories("org.my.pkg")instead of@EnableRedisRepositories(basePackages="org.my.pkg").- Returns:
- basePackages
- Default:
- {}
-
basePackages
Base packages to scan for annotated components.value()is an alias for (and mutually exclusive with) this attribute. UsebasePackageClasses()for a type-safe alternative to String-based package names.- Returns:
- basePackages as a String
- Default:
- {}
-
basePackageClasses
Class<?>[] basePackageClassesType-safe alternative tobasePackages()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[] excludeFiltersSpecifies which types are not eligible for component scanning.- Returns:
- array of components to exclude
- Default:
- {}
-
includeFilters
org.springframework.context.annotation.ComponentScan.Filter[] includeFiltersSpecifies which types are eligible for component scanning. Further narrows the set of candidate components from everything inbasePackages()to everything in the base packages that matches the given filter or filters.- Returns:
- array of components to include
- Default:
- {}
-
repositoryImplementationPostfix
String repositoryImplementationPostfixReturns the postfix to be used when looking up custom repository implementations. Defaults to Impl. So for a repository namedPersonRepositorythe corresponding implementation class will be looked up scanning forPersonRepositoryImpl.- Returns:
- postfix for the dynamically generated repository class
- Default:
- "Impl"
-
namedQueriesLocation
String namedQueriesLocationConfigures 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 queryLookupStrategyReturns the key of theQueryLookupStrategyto be used for lookup queries for query methods. Defaults toQueryLookupStrategy.Key.CREATE_IF_NOT_FOUND.- Returns:
- lookup strategy key
- Default:
- CREATE_IF_NOT_FOUND
-
repositoryFactoryBeanClass
Class<?> repositoryFactoryBeanClassReturns theFactoryBeanclass to be used for each repository instance. Defaults toRedisRepositoryFactoryBean.- Returns:
- repository factory bean class
- Default:
- com.redis.om.spring.repository.support.RedisDocumentRepositoryFactoryBean.class
-
repositoryBaseClass
Class<?> repositoryBaseClassConfigure 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 keyValueTemplateRefConfigures the name of theKeyValueOperationsbean to be used with the repositories detected.- Returns:
- key value operations template name
- Default:
- "redisJSONKeyValueTemplate"
-
considerNestedRepositories
boolean considerNestedRepositoriesConfigures 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 redisTemplateRefConfigures the bean name of theRedisOperationsto be used. Defaulted to redisTemplate.- Returns:
- name of the ops template
- Default:
- "redisTemplate"
-
indexConfiguration
Class<? extends org.springframework.data.redis.core.index.IndexConfiguration> indexConfigurationSet 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> keyspaceConfigurationSet 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 enableKeyspaceEventsConfigure usage ofKeyExpirationEventMessageListener.- Returns:
- whether to enable keyspace events
- Since:
- 1.8
- Default:
- OFF
-
messageListenerContainerRef
String messageListenerContainerRefConfigure the name of theRedisMessageListenerContainerbean to be used for keyspace event subscriptions. Defaults to use an anonymous managed instance byRedisKeyValueAdapter.- Returns:
- the messageListenerContainerRef
- Since:
- 2.7.2
- Default:
- ""
-
shadowCopy
org.springframework.data.redis.core.RedisKeyValueAdapter.ShadowCopy shadowCopyConfiguration flag controlling storage of phantom keys (shadow copies) of expiring entities to read them later when publishingkeyspace events.- Returns:
- shadow copy
- Since:
- 2.4
- Default:
- DEFAULT
-
keyspaceNotificationsConfigParameter
String keyspaceNotificationsConfigParameterConfigure the notify-keyspace-events property if not already set. Use an emptyStringto keep (not alter) existing server configuration.- Returns:
- Ex by default.
- Since:
- 1.8
- Default:
- "Ex"
-