Redis Repositories

本章解释了 Spring Data 存储库和 Redis 规范的基本原理。在继续了解 Redis 规范之前,请确保你对基本概念有透彻的了解。

This chapter explains the basic foundations of Spring Data repositories and Redis specifics. Before continuing to the Redis specifics, make sure you have a sound understanding of the basic concepts.

Spring Data 存储库抽象的目标是显著减少为各种持久性存储实现数据访问层所需的样板代码量。

The goal of the Spring Data repository abstraction is to significantly reduce the amount of boilerplate code required to implement data access layers for various persistence stores.

使用 Redis 存储库可让你在 Redis 散列中无缝地转换和存储域对象、应用自定义映射策略以及使用次级索引。

Working with Redis Repositories lets you seamlessly convert and store domain objects in Redis Hashes, apply custom mapping strategies, and use secondary indexes.

Redis 存储库至少需要 Redis 服务器版本 2.8.0,并且不支持事务。请务必将“ RedisTemplate”与“ disabled transaction support”结合使用。

Redis Repositories require at least Redis Server version 2.8.0 and do not work with transactions. Make sure to use a RedisTemplate with disabled transaction support.