I am working on a Spring-MVC application in which I am inserting a Person object in Redis. Now When inserting the object, I also need to provide the hashCode value for Person retrieved. Is there any way, I can retrieve the Person object without passing the hashCode, just the key part. Kindly let me know. Here is the insert code :
Insert code :
Person person = // person retrieved from DB.
this.userAppRegistration.getRedisTemplate().opsForHash().put(String.valueOf(person.getId()),person.hashCode(),person);
Retrieval code :
this.userAppRegistration.getRedisTemplate().opsForHash().get("Key_Available",)
I don't have access to hashcode of the Person I inserted at this point. How can I still retrieve the Person object using only key. Thanks a lot. :-)