I am using Spring Data Redis but the official docs confused me:
<!-- redis template definition -->
<bean id="redisTemplate"
class="org.springframework.data.redis.core.RedisTemplate"
p:connection-factory-ref="jedisConnectionFactory"/>
the redisTemplate
was injected into ListOperations
:
// inject the template as ListOperations
@Resource(name="redisTemplate")
private ListOperations<String, String> listOps;
but the RedisTemplate didn't extend the ListOperations:
- public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperations<K, V>, BeanClassLoaderAware
- public class RedisAccessor implements InitializingBean
I am wondering how is redisTemplate injected into XXXOperations.
my spring-data-redis version is 1.8.1.RELEASE jedis version is 2.9.0