/** * Constructor; supply delegate. */ public QueryResultCacheImpl(QueryCache cache) { _cache = new DelegatingQueryCache(cache, PersistenceExceptions.TRANSLATOR); }
public void evictAll() { _cache.clear(); }
public boolean equals(Object other) { if (other == this) return true; if (!(other instanceof QueryResultCacheImpl)) return false; return _cache.equals(((QueryResultCacheImpl) other)._cache); } }
public void evict(Query q) { if (_cache.getDelegate() != null) _cache.remove(toQueryKey(q)); }
public QueryResult remove(QueryKey qk) { if (_cache == null) return null; try { return _cache.remove(qk); } catch (RuntimeException re) { throw translate(re); } }
public void unpin(Query q) { if (_cache.getDelegate() != null) _cache.unpin(toQueryKey(q)); }
public void pin(Query q) { if (_cache.getDelegate() != null) _cache.pin(toQueryKey(q)); }
/** * Return the native delegate. */ public QueryCache getInnermostDelegate() { return (_del == null) ? _cache : _del.getInnermostDelegate(); }
/** * Delegate. */ public QueryCache getDelegate() { return _cache.getDelegate(); }
public void evictAll(Class cls) { _cache.onTypesChanged(new TypesChangedEvent(this, Collections.singleton(cls))); }
public int hashCode() { return (_cache == null) ? 0 : _cache.hashCode(); }
public void writeLock() { if (_cache == null) return; try { _cache.writeLock(); } catch (RuntimeException re) { throw translate(re); } }
public void evict(Query q) { if (_cache.getDelegate() != null) _cache.remove(toQueryKey(q)); }
public void unpin(Query q) { if (_cache.getDelegate() != null) _cache.unpin(toQueryKey(q)); }
public void pin(Query q) { if (_cache.getDelegate() != null) _cache.pin(toQueryKey(q)); }
/** * Return the native delegate. */ public QueryCache getInnermostDelegate() { return (_del == null) ? _cache : _del.getInnermostDelegate(); }
/** * Delegate. */ public QueryCache getDelegate() { return _cache.getDelegate(); }
public void evictAll(Class cls) { _cache.onTypesChanged(new TypesChangedEvent(this, Collections.singleton(cls))); }
public int hashCode() { return (_cache == null) ? 0 : _cache.hashCode(); }
public QueryResult get(QueryKey qk) { if (_cache == null) return null; try { return _cache.get(qk); } catch (RuntimeException re) { throw translate(re); } }