Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
230 views
in Technique[技术] by (71.8m points)

java - Save key-value in redis with HSET function

Hi i am have java object , Student with fields id, name, ...
I'am need save this object in key-value format in redis in memory, where key is Student.id and value is Student object. I am need do that with redis HSET function. Now i am do it with HashOperations class:

    HashOperations hashOperations = redisTemplate.opsForHash();
    hashOperations.put(student.getId(), student.getId().hashCode(), student);

but in redis i got key like this "xacxedx00x05tx00x06111111"
am i doing right?
What it means, why i dont see only string value 11111 in keys, can someone explain please

question from:https://stackoverflow.com/questions/65952096/save-key-value-in-redis-with-hset-function

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...