java - 春 - ehCache
私は春のehcache実装を使用しています春のコンテキストは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
}
}