【发布时间】:2021-04-22 15:48:54
【问题描述】:
我有EmployeeDto 作为Object,它没有与数据库同步。
我想将EmployeeDto 放入 Redis 缓存中。我已经通过一个示例,我可以看到数据库实体正在使用 Redis 缓存进行缓存,但是我们如何在 Redis 缓存中存储和检索非数据库实体?
@Getter
@Setter
public class EmployeeDto {
private long employeeId;
private String requestId;
private String timestamp;
private String employeeName;
}
【问题讨论】:
-
你能分享一下EmployeeDto类吗?
-
@GuyKorland 我已添加 EmployeeDto。
-
所以你使用的是 Spring-Data-Redis?
-
@GuyKorland 是的,我们正在使用 Spring-Data-Redis。
标签: java spring-boot redis jedis redis-cache