From bfb95793c68e6b114acaa5847093df453542ac8d Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 25 Jan 2011 14:29:25 +0200 Subject: [PATCH] DATAKV-28 + add docs regarding the injection of views/operations --- src/docbkx/reference/redis.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/docbkx/reference/redis.xml b/src/docbkx/reference/redis.xml index ae6b1df4d..3a65af587 100644 --- a/src/docbkx/reference/redis.xml +++ b/src/docbkx/reference/redis.xml @@ -262,6 +262,21 @@ redisTemplate.opsForList().leftPush(userId, url.toExternalForm()); } }]]> + + For cases where a certain template view is needed, one the view as a dependency and inject the template: the container will automatically perform the conversion + eliminating the opsFor[X] calls: + + listOps; + + public void addLink(String userId, URL url) { + listOps.leftPush(userId, url.toExternalForm()); + } +}]]> + As with the other Spring templates, RedisTemplate and StringRedisTemplate allow the developer to talk directly to Redis through the RedisCallback interface: this gives complete control to the developer as it talks directly to the RedisConnection.