當前位置:成語大全網 - 書法字典 - org . spring framework . data . redis . core . redis template如何檢查壹個鍵的哈希?

org . spring framework . data . redis . core . redis template如何檢查壹個鍵的哈希?

@測試

public void queryCacheKey()引發異常{

String key = " 00000002

string hashKey = " 513117070 ";

//檢查哈希鍵是否存在。如果存在,則為真,否則為假。

boolean hasKey = redis template . opsforhash()。hasKey(key,hashKey);

system . out . println(hasKey);

if(hasKey){

//值

object object = redis template . opsforhash()。get(key,hashKey);

System.out.println("取出存儲鍵值:"+object . tostring());

}

}