You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why in the series of OpsFor* methods of RedisTemplate, 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 this
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
The text was updated successfully, but these errors were encountered: