I have a redis entity using a kotlin data class and its Id should be a combination of few other fields from the same class. Can this be achieved by defining setter for Id field instead of computing it outside of data class?
@RedisHash("Game")
data class Game(
@Id
val generatedId: String = "Default_ID",
val name: String,
val location: String,
val homeTeam: String,
val awayTeam: String
)
// want something like this
var generatedId : String = "DEFAULT_ID"
get() = "${name}${location}"
// or even better
var generated_Id : String = "${name}${location}"