У меня есть таблица RedisHa sh, которую я моделирую в весенних данных, например:
@RedisHash("Entity")
@Data
@AllArgsConstructor
public class Entity implements Serializable {
private String id;
private String status;
private String name;
}
У меня есть EntityRepository, подобный этому:
@Repository
public interface EntityRepository extends CrudRepository<Entity, String> {}
У меня есть EntityService, подобный этому:
@Service
public class EntityService {
@Autowired
private EntityRepository entityRepository;
public List<Entity> getAllByName(String name) {
// Code that gets all Entities stored in my redis table that have a certain name
}
public List<Entity> getAllByStatus(String status) {
// Code that gets all Entities stored in my redis table that have a certain status
}
Как я могу найти redis для всех сущностей, которые имеют определенное имя / имеют определенный статус?