How can I get one of my spring configuration variables in an annotation that not inside of a class scope? Currently, I am doing this:
@Data
@RedisHash(value = "MyEntity", timeToLive = 604800 )
public class MyEntity{
private String id;
private String name;
}
but what I really want to do is this (or something equivalent):
@Data
@RedisHash(value = "MyEntity", timeToLive = @Value("${spring.redis.expire}") )
public class MyEntity{
private String id;
private String name;
}
Any solutions which allow me to access my config variables in my application.yml in my annotations (in this case, completing the value for my @RedisHash annotation)???