org.datanucleus.jpa
Class JPAQueryCache

java.lang.Object
  extended by org.datanucleus.jpa.JPAQueryCache
All Implemented Interfaces:
java.io.Serializable

public class JPAQueryCache
extends java.lang.Object
implements java.io.Serializable

Implementation of the JPA QueryCache. Provides a wrapper and hands off calls to the underlying query cache.

See Also:
Serialized Form

Constructor Summary
JPAQueryCache(org.datanucleus.store.query.cache.QueryResultsCache cache)
          Constructor.
 
Method Summary
 void evict(javax.persistence.Query query)
          Evict all cached results for the provided query.
 void evict(javax.persistence.Query query, java.util.Map params)
          Evict the cached results for the provided query and params.
 void evictAll()
          Evict the parameter instances from the second-level cache.
 org.datanucleus.store.query.cache.QueryResultsCache getQueryCache()
          Accessor for the underlying query cache.
 void pin(javax.persistence.Query query)
          Method to pin the specified query in the cache, preventing garbage collection.
 void pin(javax.persistence.Query query, java.util.Map params)
          Method to pin the specified query in the cache, preventing garbage collection.
 void unpin(javax.persistence.Query query)
          Method to unpin the specified query from the cache, allowing garbage collection.
 void unpin(javax.persistence.Query query, java.util.Map params)
          Method to unpin the specified query from the cache, allowing garbage collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPAQueryCache

public JPAQueryCache(org.datanucleus.store.query.cache.QueryResultsCache cache)
Constructor.

Parameters:
cache - Query results cache
Method Detail

getQueryCache

public org.datanucleus.store.query.cache.QueryResultsCache getQueryCache()
Accessor for the underlying query cache.

Returns:
Underlying query cache.

evict

public void evict(javax.persistence.Query query)
Evict all cached results for the provided query.

Parameters:
query - The JPA query

evict

public void evict(javax.persistence.Query query,
                  java.util.Map params)
Evict the cached results for the provided query and params.

Parameters:
query - The JPA query
params - The input params

evictAll

public void evictAll()
Evict the parameter instances from the second-level cache. All instances in the EntityManagers cache are evicted from the second-level cache.


pin

public void pin(javax.persistence.Query query)
Method to pin the specified query in the cache, preventing garbage collection.

Parameters:
query - The query

pin

public void pin(javax.persistence.Query query,
                java.util.Map params)
Method to pin the specified query in the cache, preventing garbage collection.

Parameters:
query - The query
params - Its params

unpin

public void unpin(javax.persistence.Query query)
Method to unpin the specified query from the cache, allowing garbage collection.

Parameters:
query - The query

unpin

public void unpin(javax.persistence.Query query,
                  java.util.Map params)
Method to unpin the specified query from the cache, allowing garbage collection.

Parameters:
query - The query
params - Its params


Copyright © 2011. All Rights Reserved.