redisTemplate进行自增操作例子
生活随笔
收集整理的這篇文章主要介紹了
redisTemplate进行自增操作例子
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
代碼
String key = "redisAtomicLong:getAndIncrement:add";
RedisAtomicLong entityIdCounter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory());
Long increment = entityIdCounter.getAndIncrement();
System.out.println(increment);
?
效果
總結
以上是生活随笔為你收集整理的redisTemplate进行自增操作例子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在deepin 15.5中安装vs co
- 下一篇: 成员变量和类变量的区别: