@Override public Boolean putIfAbsent(HK key, HV value) { return ops.putIfAbsent(getKey(), key, value); }
/** * 仅当hashKey不存在时才设置 * * @param key * @param hashKey * @param value * @return */ public Boolean hPutIfAbsent(String key, String hashKey, String value) { return redisTemplate.opsForHash().putIfAbsent(key, hashKey, value); }
@Override public Boolean putIfAbsent(HK key, HV value) { return ops.putIfAbsent(getKey(), key, value); }
@Override public void putIfAbsent(String key, M value) { redisTemplate.opsForHash().putIfAbsent(mapKey, key, value); }
@Override public void putIfAbsent(String key, M value) { redisTemplate.opsForHash().putIfAbsent(mapKey, key, value); }
@Override public void putIfAbsent(String key, M value) { redisTemplate.opsForHash().putIfAbsent(mapKey, key, value); }
@Override public void hsetIfAbsent(String key, String field, String value) { redisTemplate.opsForHash().putIfAbsent(key, field, value); }
@Override public Boolean putIfAbsent(HK key, HV value) { return ops.putIfAbsent(getKey(), key, value); }
@Override public TacInst createTacMsInst(TacInst tacInst) { // 校验参数 checkInst(tacInst); long msInstId = sequenceCounter.incrementAndGet(); if (msInstId <= 0) { throw new IllegalStateException("error on get id "); } tacInst.setId(msInstId); hashOperations.putIfAbsent(getMainKey(), String.valueOf(tacInst.getId()), tacInst); hashOperations.put(getMainKey() + tacInst.getMsCode(), String.valueOf(tacInst.getId()), tacInst); return tacInst; }
@Override public TacInst createTacMsInst(TacInst tacInst) { // 校验参数 checkInst(tacInst); long msInstId = sequenceCounter.incrementAndGet(); if (msInstId <= 0) { throw new IllegalStateException("error on get id "); } tacInst.setId(msInstId); hashOperations.putIfAbsent(getMainKey(), String.valueOf(tacInst.getId()), tacInst); hashOperations.put(getMainKey() + tacInst.getMsCode(), String.valueOf(tacInst.getId()), tacInst); return tacInst; }