Java 类org.springframework.data.redis.core.BoundHashOperations 实例源码

项目:simbest-cores    文件:GenericCache.java   
/**
 * 清空缓存
 */
@Override
public void removeAll(){
    log.debug("@GenericCache remove all cache");
    Set<K> keys = getKeyHashOps().keys();
    if(keys.size() > 0){
        getKeyHashOps().delete(keys.toArray());//删除主键缓存

        if(unique != null){ //删除默认唯一键缓存
            getUniqueHashOps().delete(getUniqueHashOps().keys().toArray());
        }       

        for(String keyName: customKeys){ //删除自定义字段缓存
            BoundHashOperations<String, Object, V> map = customHashOpsHolder.get(keyName);
            if(map != null)
                map.delete(map.keys().toArray());
        }
    }
}
项目:simbest-cores    文件:GenericCache.java   
@Override
public V loadByCustom(String keyName, Object keyValue){
    if(StringUtils.isNotEmpty(keyName) && keyValue!=null){
        V v = null;
        BoundHashOperations<String, Object, V> customHashOps = customHashOpsHolder.get(coreConfig.getCtx()+Constants.COLON+clazz.getSimpleName()+Constants.COLON+keyName);
        if(customHashOps != null)
            v = customHashOps.get(keyValue);
        log.debug(String.format("@GenericCache get cache value with custom key name: %s and key value: %s and return value: %s ", keyName, keyValue, v));
        return v;
    }else{
        log.warn(String.format("@GenericCache cant not get cache value with empty keyName %s and empty keyValue %s",keyName,keyValue));
        return null;
    }
}
项目:openyu-commons    文件:RedisBaoSupporter.java   
@Override
public <HK, HV> BoundHashOperations<K, HK, HV> boundHashOps(K key) {
    try {
        return redisTemplate.boundHashOps(key);
    } catch (Exception ex) {
        throw new RedisBaoException(ex);
    }
}
项目:simbest-cores    文件:GenericAdvanceService.java   
@Override
public BoundHashOperations<String, K, V> getKeyHashOps() {
    return getCacheService().getKeyHashOps();
}
项目:simbest-cores    文件:GenericAdvanceService.java   
@Override
public BoundHashOperations<String, Object, V> getUniqueHashOps() {
    return getCacheService().getUniqueHashOps();
}
项目:simbest-cores    文件:GenericCache.java   
/**
 * @return the keyHashOps
 */
@Override
public BoundHashOperations<String, K, V> getKeyHashOps() {
    return keyHashOps;
}
项目:simbest-cores    文件:GenericCache.java   
/**
 * @param keyHashOps the keyHashOps to set
 */
public void setKeyHashOps(BoundHashOperations<String, K, V> keyHashOps) {
    this.keyHashOps = keyHashOps;
}
项目:simbest-cores    文件:GenericCache.java   
/**
 * @param uniqueHashOps the uniqueHashOps to set
 */
public void setUniqueHashOps(
        BoundHashOperations<String, Object, V> uniqueHashOps) {
    this.uniqueHashOps = uniqueHashOps;
}
项目:simbest-cores    文件:GenericCache.java   
/**
 * @return the uniqueHashOps
 */
@Override
public BoundHashOperations<String, Object, V> getUniqueHashOps() {
    return uniqueHashOps;
}
项目:redis-admin    文件:MyRedisTemplate.java   
@Override
public <HK, HV> BoundHashOperations<K, HK, HV> boundHashOps(K key) {
    throw new MethodNotSupportException("myRedisTemplate not support this method : boundHashOps(K key) , please use opsForXX");
    //return new DefaultBoundHashOperations<K, HK, HV>(key, this);
}
项目:spring-data-keyvalue-redis    文件:RedisKeyValueAdapter.java   
BoundHashOperations<byte[], byte[], Object> getHashOps(Serializable keyspace) {
    return redisOps.boundHashOps(converter.getConversionService().convert(keyspace, byte[].class));
}
项目:data-acquisition    文件:RedisRequestRepository.java   
public RedisRequestRepository(BoundHashOperations<String, String, Request> hashOps) {
    this.hashOps = hashOps;
}
项目:spring-session    文件:RedisOperationsSessionRepository.java   
/**
 * Gets the {@link BoundHashOperations} to operate on a {@link Session}.
 * @param sessionId the id of the {@link Session} to work with
 * @return the {@link BoundHashOperations} to operate on a {@link Session}
 */
private BoundHashOperations<Object, Object, Object> getSessionBoundHashOperations(
        String sessionId) {
    String key = getSessionKey(sessionId);
    return this.sessionRedisOperations.boundHashOps(key);
}
项目:simbest-cores    文件:IGenericCache.java   
/**
 * 获取主键缓存Operations
 * @return
 */
BoundHashOperations<String, K, V> getKeyHashOps();
项目:simbest-cores    文件:IGenericCache.java   
/**
 * 获取唯一键缓存Operations
 * @return
 */
BoundHashOperations<String, Object, V> getUniqueHashOps();
项目:spring-cloud-dataflow    文件:RedisUriRegistry.java   
/**
 * Return the {@link BoundHashOperations} operation for Redis.
 *
 * @return {@code BoundHashOperations} for Redis
 */
private BoundHashOperations<String, String, String> hashOps() {
    return this.redisOperations.boundHashOps("spring.cloud.resource.uri");
}
项目:openyu-commons    文件:RedisBao.java   
<HK, HV> BoundHashOperations<K, HK, HV> boundHashOps(K key);