在不使用嵌套注释的情况下向@Cacheable注释添加属性

时间:2012-11-07 18:29:08

标签: java spring annotations ehcache

所以我在Spring Roo项目中使用了ehcache-spring-annotations 1.2.0,每次它运行到它没有创建的嵌套注释时,Roo总是适合。有没有办法在不使用嵌套注释的情况下重写此注释?

@Cacheable(cacheName = "CacheName", 
           keyGenerator = @KeyGenerator (
               name = "ListCacheKeyGenerator",
               properties = {
                   @Property(name="useReflection", value="true"),
                   @Property(name="checkforCycles", value="true")}))
public void method() {
    // do something that needs cached
}

0 个答案:

没有答案