0

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
     }


}
4

1 に答える 1