开发者

How to cache items which are returned by a list query? Using EHCache?

i am successfully able to cache results for queries that retrieve a single value.

@Cacheable(cacheName = "resourceCache")
public Resource find(int id) throws ResourceNotFoundException{
 ...
}

But for effiency reasons i need to implemented a method that effectively queries the database to retrieve a list of resources and look into the cache i开发者_C百科f possible elements already exist and if not put these in the cache.

How could i implement this? Any suggestions, hints or tips are appreciated?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜