blob: 94cf2c2a6c4833962a368fa4c7d0d0167e91126f [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_252) on Fri Jul 16 09:38:48 UTC 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CacheType (EclipseLink 3.0.2, API Reference)</title>
<meta name="date" content="2021-07-16">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="CacheType (EclipseLink 3.0.2, API Reference)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">EclipseLink 3.0.2, API Reference</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/eclipse/persistence/config/CacheIsolationType.html" title="enum in org.eclipse.persistence.config"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/eclipse/persistence/config/CacheUsage.html" title="class in org.eclipse.persistence.config"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/persistence/config/CacheType.html" target="_top">Frames</a></li>
<li><a href="CacheType.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#methods.inherited.from.class.java.lang.Object">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li>Method</li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.eclipse.persistence.config</div>
<h2 title="Class CacheType" class="title">Class CacheType</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.eclipse.persistence.config.CacheType</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">CacheType</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">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.
<p>JPA persistence property Usage:
<p>for all entities append DEFAULT suffix to CACHE_TYPE_ prefix:
<p><code>properties.add(PersistenceUnitProperties.CACHE_TYPE_DEFAULT, CacheType.Weak);</code>
<p>for a single entity append either entity name or a full class name to CACHE_TYPE_ prefix:
<p><code>properties.add(PersistenceUnitProperties.CACHE_TYPE_ + "Employee", CacheType.Weak);</code>
<p><code>properties.add(PersistenceUnitProperties.CACHE_TYPE_ + "my.test.Employee", CacheType.Weak);</code>
<p>Values are case-insensitive.
"" could be used instead of default value CacheType.DEFAULT.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/config/PersistenceUnitProperties.html#CACHE_SHARED_"><code>PersistenceUnitProperties.CACHE_SHARED_</code></a>,
<a href="../../../../org/eclipse/persistence/config/PersistenceUnitProperties.html#CACHE_TYPE_"><code>PersistenceUnitProperties.CACHE_TYPE_</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/config/CacheType.html#DEFAULT">DEFAULT</a></span></code>
<div class="block">The default cache type is SoftWeak.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/config/CacheType.html#Full">Full</a></span></code>
<div class="block">A Soft cache holds all objects read by the application.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/config/CacheType.html#HardWeak">HardWeak</a></span></code>
<div class="block">A HardWeak cache holds all objects in use by the application,
and a fixed size sub-cache of MRU objects using normal (hard) references.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/config/CacheType.html#NONE">NONE</a></span></code>
<div class="block">NONE does not cache any objects.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/config/CacheType.html#Soft">Soft</a></span></code>
<div class="block">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.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/config/CacheType.html#SoftWeak">SoftWeak</a></span></code>
<div class="block">A SoftWeak cache holds all objects in use by the application,
and a fixed size sub-cache of MRU objects using Soft references.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/config/CacheType.html#Weak">Weak</a></span></code>
<div class="block">A Weak cache holds all objects in use by the application,
but allows any un-referenced objects to be free to garbage collection.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/config/CacheType.html#CacheType--">CacheType</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="Weak">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Weak</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> Weak</pre>
<div class="block">A Weak cache holds all objects in use by the application,
but allows any un-referenced objects to be free to garbage collection.
This guarantees object identity, allows optimal garbage collection, but provides little caching benefit.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#org.eclipse.persistence.config.CacheType.Weak">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="Soft">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Soft</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> Soft</pre>
<div class="block">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.
This guarantees object identity, allows garbage collection when memory is low, and provides optimal caching benefit.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#org.eclipse.persistence.config.CacheType.Soft">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="SoftWeak">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>SoftWeak</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> SoftWeak</pre>
<div class="block">A SoftWeak cache holds all objects in use by the application,
and a fixed size sub-cache of MRU objects using Soft references.
It allows any un-referenced objects not in the sub-cache to be free to garbage collection,
and the objects in the sub-cache are free to garbage collect only when the JVM decides memory is low.
This guarantees object identity, allows configurable garbage collection, and provides configurable caching benefit.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#org.eclipse.persistence.config.CacheType.SoftWeak">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="HardWeak">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>HardWeak</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> HardWeak</pre>
<div class="block">A HardWeak cache holds all objects in use by the application,
and a fixed size sub-cache of MRU objects using normal (hard) references.
It allows any un-referenced objects not in the sub-cache to be free to garbage collection,
but not objects in the sub-cache.
This guarantees object identity, allows configurable garbage collection, and provides configurable caching benefit.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#org.eclipse.persistence.config.CacheType.HardWeak">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="Full">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Full</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> Full</pre>
<div class="block">A Soft cache holds all objects read by the application.
It does not allow any garbage collection. *
This guarantees object identity, allows no garbage collection, and provides complete caching benefit.
<p>WARNING: This cache type should only be used for a fixed sized number of objects,
otherwise it will lead to an eventual memory leak.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#org.eclipse.persistence.config.CacheType.Full">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="NONE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NONE</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> NONE</pre>
<div class="block">NONE does not cache any objects.
It allows any un-referenced objects to be free to garbage collection.
This provides no object identity, allows complete garbage collection, and provides no caching benefit.
<p>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.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/config/PersistenceUnitProperties.html#CACHE_SHARED_"><code>PersistenceUnitProperties.CACHE_SHARED_</code></a>,
<a href="../../../../constant-values.html#org.eclipse.persistence.config.CacheType.NONE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="DEFAULT">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DEFAULT</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> DEFAULT</pre>
<div class="block">The default cache type is SoftWeak.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#org.eclipse.persistence.config.CacheType.DEFAULT">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="CacheType--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>CacheType</h4>
<pre>public&nbsp;CacheType()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">EclipseLink 3.0.2, API Reference</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/eclipse/persistence/config/CacheIsolationType.html" title="enum in org.eclipse.persistence.config"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/eclipse/persistence/config/CacheUsage.html" title="class in org.eclipse.persistence.config"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/persistence/config/CacheType.html" target="_top">Frames</a></li>
<li><a href="CacheType.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#methods.inherited.from.class.java.lang.Object">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li>Method</li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2007&#x2013;2021 <a href="http://www.eclipse.org/eclipselink">Eclipse.org - EclipseLink Project</a>. All rights reserved.</small></p>
</body>
</html>