|
EclipseLink 1.1.4, build 'v20100812-r7860' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.config.CacheType
public class CacheType
Cache type persistence property values. The cache type defines the type of cache usage for the entities. Its usage depends on the memory and caching requirements of the entity. If no caching is desired at all the PersistenceUnitProperties.CACHE_SHARED_ should instead be used.
JPA persistence property Usage:
for all entities append DEFAULT suffix to CACHE_TYPE_ prefix:
properties.add(PersistenceUnitProperties.CACHE_TYPE_DEFAULT, CacheType.Weak);
for a single entity append either entity name or a full class name to CACHE_TYPE_ prefix:
properties.add(PersistenceUnitProperties.CACHE_TYPE_ + "Employee", CacheType.Weak);
properties.add(PersistenceUnitProperties.CACHE_TYPE_ + "my.test.Employee", CacheType.Weak);
Values are case-insensitive. "" could be used instead of default value CacheType.DEFAULT.
PersistenceUnitProperties.CACHE_SHARED_
,
PersistenceUnitProperties.CACHE_TYPE_
Field Summary | |
---|---|
static java.lang.String |
DEFAULT
The default cache type is SoftWeak. |
static java.lang.String |
Full
A Soft cache holds all objects read by the application. |
static java.lang.String |
HardWeak
A HardWeak cache holds all objects in use by the application, and a fixed size sub-cache of MRU objects using normal (hard) references. |
static java.lang.String |
NONE
NONE does not cache any objects. |
static java.lang.String |
Soft
A Soft cache holds all objects read by the application, but allows any un-referenced objects to be free to garbage collection only when the JVM decides memory is low. |
static java.lang.String |
SoftWeak
A SoftWeak cache holds all objects in use by the application, and a fixed size sub-cache of MRU objects using Soft references. |
static java.lang.String |
Weak
A Weak cache holds all objects in use by the application, but allows any un-referenced objects to be free to garbage collection. |
Constructor Summary | |
---|---|
CacheType()
|
Method Summary |
---|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String Weak
public static final java.lang.String Soft
public static final java.lang.String SoftWeak
public static final java.lang.String HardWeak
public static final java.lang.String Full
WARNING: This cache type should only be used for a fixed sized number of objects, otherwise it will lead to an eventual memory leak.
public static final java.lang.String NONE
WARNING: This cache type should normally not be used. Instead disable the share cache through PersistenceUnitProperties.CACHE_SHARED_. Lack of object identity can lead to infinite loops for objects that have circular references and no indirection.
PersistenceUnitProperties.CACHE_SHARED_
,
Constant Field Valuespublic static final java.lang.String DEFAULT
Constructor Detail |
---|
public CacheType()
|
EclipseLink 1.1.4, build 'v20100812-r7860' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |