I am trying to cache List in a Class as follows:
Class Person{
@Autowired
PersonService personService;
.
.
.
.
@Cacheable("allStrings")
public List<Strings> getAllStrings(){
return personService.getStrings();
}
}
personService has getStrings() which will return all required strings. Eventhough I made getAllStrings() in Person class as Cacheable , cache is not created.
Is it because of proxy? How can I made above method cache without caching getStrings() in service?
Can't @Cacheable can't create cache if method is getting data from other service?