修改Set可能导致嵌套的问题

feature/model
BecomeDream 4 years ago committed by Gitee
parent ecfe7006e2
commit e8f63b2994

@ -136,10 +136,15 @@ public class RedisCache
* @param dataSet
* @return
*/
public <T> long setCacheSet(final String key, final Set<T> dataSet)
public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet)
{
Long count = redisTemplate.opsForSet().add(key, dataSet);
return count == null ? 0 : count;
BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
Iterator<T> it = dataSet.iterator();
while (it.hasNext())
{
setOperation.add(it.next());
}
return setOperation;
}
/**

Loading…
Cancel
Save