Closed GoogleCodeExporter closed 9 years ago
Agree this is valid request, in fact the current @PartialCacheKey example in
the wiki alludes to this functionality. By virtue of the updateWather method,
it certainly fooled me...
The problem is I really need this function.
Original comment by ashleyb....@gmail.com
on 20 Aug 2010 at 2:39
The only reasonable way to do this is via having your application code
manipulate the Ehcache instance directly. The way the framework is designed
having a method like:
@Cacheable(cacheName="carsCache")
List<Car> getCars();
Will result in a single cache entry in carsCache where the value stored is
List<Car>
Having an annotation return all the values in the cache doesn't make sense as
there would be no point to ever calling the actual method implementation, you'd
always just list the cache values.
There is nothing stopping an application that uses these annotations from also
directly accessing the Ehcache targeted by the annotation.
The current combination of @Cacheable and @TriggersRemove allows for an object
to be cached on access and then removed from the cache based on another method
call. If you ever want the List of all members of the cache you should inject
the Ehcache instance into an application bean and access it directly to get all
the values stored in the cache.
Original comment by eric.dalquist
on 20 Aug 2010 at 3:56
Thanks for the prompt response. I'll go with your suggestion since manipulating
ehcache directly would be a bit self-defeating.
Original comment by ashleyb....@gmail.com
on 20 Aug 2010 at 5:05
Original issue reported on code.google.com by
h0c...@gmail.com
on 30 Jul 2010 at 4:18