javax.persistence.Cache - JPA interface
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:
- JPA 2.0
Learn how to use Cache in
Chapter 3 of the ObjectDB/JPA manual.
Whether the cache contains data for the given entity.
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
- Since:
- JPA 2.0
Remove the data for entities of the specified class (and its subclasses) from the cache.
Remove the data for entities of the specified class (and its subclasses) from the cache.
- Parameters:
-
cls
- entity class
- Since:
- JPA 2.0
Remove the data for the given entity from the cache.
Remove the data for the given entity from the cache.
- Parameters:
-
cls
- entity class -
primaryKey
- primary key
- Since:
- JPA 2.0
Clear the cache.
Clear the cache.
- Since:
- JPA 2.0