Closed HK-hub closed 2 months ago
This behavior has existed since the earliest days of hash operations (Early 2010). I cannot tell why this is, though I assume that the code didn't want to mess with generic assignability. Its reactive variant, ReactiveRedisTemplate.opsForHash()
uses a cached variant. Tests pass when we change the object to a cached variant so there's no reason why it needs to remain this way.
Curious question
Why in the series of
OpsFor*
methods ofRedisTemplate
,opsForHash()
always returns a new instance object,valueOps
,listOps
,setOps
,zSetOps
and other data structures return final modified instantiated property objects. Is there a particular reason for thisdependency
opsForHash() Method
this is opsForHash() method body for
3.2.2
versionand the next code is some opsFor* that return the singleton object
I would like to know why the design is like this, I searched for related questions but found no discussion about it