Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2219

How to insert to redis with combined id from 2 fields in spring data?

$
0
0

I have an entity as Student and it has 3 fields: name, surname, score. I want to store them into redis, but my key must be name and surname together and score will be the value.

I tried to do something like this but i do know what to Student as id?

@RedisHash(value = "Student")
public class Student {

@Id
private String uuid = UUID.randomUUID().toString();

@Indexed
private String name;
@Indexed
private String surname;
private Double score;

}

How can i design my model class, how can I achieve that id as name and surname and the value must be score?


Viewing all articles
Browse latest Browse all 2219

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>