Hi there,
I'm trying to call a @cacheable method from within the same class:
and hoping that the results from findPersons are cached as well, but the @cacheable annotation is ignored, and findPerson method got executed everytime.Code:@Cacheable(value = "defaultCache", key = "#id") public Person findPerson(int id) { return getSession().getPerson(id); } public List<Person> findPersons(int[] ids) { List<Person> list = new ArrayList<Person>(); for (int id : ids) { list.add(findPerson(id)); } return list; }
Am I doing something wrong here, or this is intended?
Thanks,
David


Reply With Quote
