本文整理了Java中org.springframework.cache.annotation.Cacheable
类的一些代码示例,展示了Cacheable
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cacheable
类的具体详情如下:
包路径:org.springframework.cache.annotation.Cacheable
类名称:Cacheable
暂无
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable("testCache")
public Long cacheNull(Object arg1) {
return null;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", unless = "#result > 10")
public Long unless(int arg) {
return (long) arg;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", sync = true)
public Object cacheSyncNull(Object arg1) {
return null;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable
public void interfaceCacheableOverride() {
}
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", sync = true)
public Long cacheSyncNull(Object arg1) {
return null;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", unless = "#result > 10")
public Long unless(int arg) {
return (long) arg;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", sync = true)
public Object cacheSyncNull(Object arg1) {
return null;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable("testCache")
public Long cacheNull(Object arg1) {
return null;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", sync = true)
public Long cacheSyncNull(Object arg1) {
return null;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", unless = "#result > 10")
public Object unless(int arg) {
return arg;
}
代码示例来源:origin: spring-projects/spring-framework
@Cacheable // cache name can be inherited from CacheConfig. There's none here
public void noCacheNameSpecified() {
}
}
代码示例来源:origin: spring-projects/spring-framework
@Cacheable("custom")
public void methodLevelCacheName() {
}
}
代码示例来源:origin: spring-projects/spring-framework
@Cacheable
public void multipleCacheConfig() {
}
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable("testCache")
public Long cache(Object arg1) {
return this.counter.getAndIncrement();
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", sync = true, condition = "#p0 == 3")
public Long conditionalSync(int classField) {
return this.counter.getAndIncrement();
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", key = "#root.methodName + #root.method.name + #root.targetClass + #root.target")
public Long rootVars(Object arg1) {
return this.counter.getAndIncrement();
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", keyGenerator = "unknownBeanName")
public Long unknownCustomKeyGenerator(Object arg1) {
return this.counter.getAndIncrement();
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", cacheManager = "unknownBeanName")
public Long unknownCustomCacheManager(Object arg1) {
return this.counter.getAndIncrement();
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable("testCache")
public Long nullValue(Object arg1) {
this.nullInvocations.incrementAndGet();
return null;
}
代码示例来源:origin: spring-projects/spring-framework
@Override
@Cacheable(cacheNames = "testCache", sync = true)
public Object cacheSync(Object arg1) {
return counter.getAndIncrement();
}
内容来源于网络,如有侵权,请联系作者删除!