org.springframework.cache.annotation.Cacheable类的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(330)

本文整理了Java中org.springframework.cache.annotation.Cacheable类的一些代码示例,展示了Cacheable类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cacheable类的具体详情如下:
包路径:org.springframework.cache.annotation.Cacheable
类名称: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();
}

相关文章