javax.persistence
Interface Cache


public interface Cache

Interface used to interact with the second-level cache. If a cache is not in use, the methods of this interface have no effect, except for contains, which returns false.

Since:
Java Persistence 2.0

Method Summary
 boolean contains(java.lang.Class cls, java.lang.Object primaryKey)
          Whether the cache contains data for the given entity.
 void evict(java.lang.Class cls)
          Remove the data for entities of the specified class (and its subclasses) from the cache.
 void evict(java.lang.Class cls, java.lang.Object primaryKey)
          Remove the data for the given entity from the cache.
 void evictAll()
          Clear the cache.
 

Method Detail

contains

boolean contains(java.lang.Class cls,
                 java.lang.Object primaryKey)
Whether the cache contains data for the given entity.

Parameters:
cls - entity class
primaryKey - primary key
Returns:
boolean indicating whether the entity is in the cache

evict

void evict(java.lang.Class cls,
           java.lang.Object primaryKey)
Remove the data for the given entity from the cache.

Parameters:
cls - entity class
primaryKey - primary key

evict

void evict(java.lang.Class cls)
Remove the data for entities of the specified class (and its subclasses) from the cache.

Parameters:
cls - entity class

evictAll

void evictAll()
Clear the cache.



Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41