java - 春天 - ehCache
我正在使用 spring ehcache 实现 spring context 给了我Cache
没有以下方法的对象
Query query = cache.createQuery();
一些机构可以建议如何createQuery
从一个Cache
对象。
Spring ehCacheManager bean
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"
p:cacheManager-ref="ehcache" />
<bean id="ehcache"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
p:configLocation="classpath:ehcache.xml" />
@Service
public class CacheServiceImpl implements CacheService {
@Autowired
EhCacheCacheManager cacheManager;
@PostConstruct
private void init() {
Cache cache = serviceCache = cacheManager.getCache("serviceCache");//Gives me Cache Object CacheObject does not have Query query = cache.createQuery(); method
}
}