I have a requirement where I need to replace mysql with Redis, so I have method for mysql in JPA as findByIdAndName. And in Redis I am storing key and Object like <Integer,Employee> (Employee is a class and Integer is Id ) so If I want to get employee object from redis based on Integer-Id I can easily get those with findById mentioned below but what if I want to get data based on Employee Name and age so any Idea how to use hashOperation in that way or how to store data in redis in way so that I can get the desired result.
For Example in RedisImplementation:
public Employee findById(Integer id) {
Employee emp = redisTemplate.opsForHash().get("EMPLOYEE_HASH",Id);
}
I want to add a method which can get data based on ID and Name like findByIdAndName