@EnableRedisRepositories - 在 Spring Data Redis 中有什么用?
@EnableRedisRepositories - What is the use of in Spring Data Redis?
我在网上搜索了很多以获得 @EnableRedisRepositories 的更多实际用法,但我没有找到。即使在我的 Spring Boot + Spring Data Redis
示例中,我删除了 @EnableRedisRepositories
但我仍然不明白它有什么区别,我仍然可以看到数据正在持久化到数据库中并且检索正常。
有人可以澄清一下吗?
我仔细阅读了这个注释,但不是每一个都清楚..
Annotation to activate Redis repositories. If no base package is configured through either {@link #value()},
{@link #basePackages()} or {@link #basePackageClasses()} it will trigger scanning of the package of annotated class.
它允许 Spring 扫描您的包以查找存储库 classes/interfaces,然后使用 Redis 作为存储来持久化您的对象 - 而不是经典的关系数据库。
Spring Data docs告诉我们:
NoSQL storage systems provide an alternative to classical RDBMS for horizontal scalability and speed. In terms of implementation, key-value stores represent one of the largest (and oldest) members in the NoSQL space.
The Spring Data Redis (SDR) framework makes it easy to write Spring applications that use the Redis key-value store by eliminating the redundant tasks and boilerplate code required for interacting with the store through Spring’s excellent infrastructure support.
我在网上搜索了很多以获得 @EnableRedisRepositories 的更多实际用法,但我没有找到。即使在我的 Spring Boot + Spring Data Redis
示例中,我删除了 @EnableRedisRepositories
但我仍然不明白它有什么区别,我仍然可以看到数据正在持久化到数据库中并且检索正常。
有人可以澄清一下吗?
我仔细阅读了这个注释,但不是每一个都清楚..
Annotation to activate Redis repositories. If no base package is configured through either {@link #value()}, {@link #basePackages()} or {@link #basePackageClasses()} it will trigger scanning of the package of annotated class.
它允许 Spring 扫描您的包以查找存储库 classes/interfaces,然后使用 Redis 作为存储来持久化您的对象 - 而不是经典的关系数据库。
Spring Data docs告诉我们:
NoSQL storage systems provide an alternative to classical RDBMS for horizontal scalability and speed. In terms of implementation, key-value stores represent one of the largest (and oldest) members in the NoSQL space.
The Spring Data Redis (SDR) framework makes it easy to write Spring applications that use the Redis key-value store by eliminating the redundant tasks and boilerplate code required for interacting with the store through Spring’s excellent infrastructure support.