I am working with Spring to assign a default value for a DTO property using @Value.
I have two DTO classes:
public class Student {
@Value("10") // default value of id should be "10"
private LookupDTO emp;
private int totalMark;
private string sub;
}
public class lookUpDTO {
private String id;
private String name;
}
How do I assign a default value for id as 10 using @Value?
Note: lookUpDTO is used by other DTO also, so I cannot use @Value in lookUpDTO directly.
Thanks in advance.