| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang> |
| <head> |
| <!-- Generated by javadoc --> |
| <title>PreparedQueryCache (OpenJPA Parent POM 4.1.1 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.7.1.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.min.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="PreparedQueryCache (OpenJPA Parent POM 4.1.1 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/PreparedQueryCache.html">Use</a></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> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </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> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.openjpa.kernel</a></div> |
| <h2 title="Interface PreparedQueryCache" class="title">Interface PreparedQueryCache</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Superinterfaces:</dt> |
| <dd><code><a href="../lib/conf/Configurable.html" title="interface in org.apache.openjpa.lib.conf">Configurable</a></code></dd> |
| </dl> |
| <dl> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><code><a href="../jdbc/kernel/PreparedQueryCacheImpl.html" title="class in org.apache.openjpa.jdbc.kernel">PreparedQueryCacheImpl</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public interface <span class="typeNameLabel">PreparedQueryCache</span> |
| extends <a href="../lib/conf/Configurable.html" title="interface in org.apache.openjpa.lib.conf">Configurable</a></pre> |
| <div class="block">A cache to create and maintain <a href="PreparedQuery.html" title="interface in org.apache.openjpa.kernel"><code>prepared queries</code></a>. |
| |
| To cache a PreparedQuery is two-stage process. In the first stage, |
| <a href="#register(java.lang.String,org.apache.openjpa.kernel.Query,org.apache.openjpa.kernel.FetchConfiguration)"><code>register(String, Query, FetchConfiguration)</code></a> register} |
| an identification key and a compiled Query Q to create a |
| hollow PreparedQuery instance P in the cache. In the second stage, after Q |
| executes, <a href="#initialize(java.lang.String,java.lang.Object)"><code>initialize(String, Object)</code></a> initialize} the hollow |
| Prepared Query P from the result of execution such as the target |
| database query PQ and its parameters. After initialization, P can |
| be used with re-parameterization for subsequent execution of the original |
| Query Q. |
| |
| The target database query PQ associated to a cached prepared query P |
| <em>may</em> depend upon query execution context such as fetch plan or |
| lock group. This cache, by design, does not monitor the context or |
| automatically invalidate an entry P when the original query Q is executed |
| with context parameters that affect the target query PQ. |
| |
| The user must notify this receiver to invalidate a cached entry P when |
| execution context changes in a way that will modify the resultant database |
| language query PQ. |
| |
| One of the built-in mechanism (available in JPA facade) is to set query hints |
| to either invalidate the query entirely or ignore the cached version for the |
| current execution.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>2.0.0</dd> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd>Pinaki Poddar</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="QueryHints.html#HINT_IGNORE_PREPARED_QUERY"><code>QueryHints.HINT_IGNORE_PREPARED_QUERY</code></a>, |
| <a href="QueryHints.html#HINT_INVALIDATE_PREPARED_QUERY"><code>This cache allows customization of whether a query can be cached or not |
| via either explicit marking of certain keys as non-cachable (which is |
| irreversible or strong) or addition/removal of exclusion patterns |
| (which is reversible or weak).</code></a>, |
| <code>#markUncachable(String)</code>, |
| <a href="#addExclusionPattern(java.lang.String)"><code>addExclusionPattern(String)</code></a>, |
| <a href="#setExcludes(java.lang.String)"><code>setExcludes(String)</code></a>, |
| <a href="#removeExclusionPattern(java.lang.String)"><code>removeExclusionPattern(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Interface</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static interface </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="PreparedQueryCache.Exclusion.html" title="interface in org.apache.openjpa.kernel">PreparedQueryCache.Exclusion</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">A structure to describe the strength and reason for excluding a query from the cache.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addExclusionPattern(java.lang.String)">addExclusionPattern</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> pattern)</code></th> |
| <td class="colLast"> |
| <div class="block">Adds the given pattern to the list of excluded patterns.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#cache(org.apache.openjpa.kernel.PreparedQuery)">cache</a></span>​(<a href="PreparedQuery.html" title="interface in org.apache.openjpa.kernel">PreparedQuery</a> q)</code></th> |
| <td class="colLast"> |
| <div class="block">Cache the given PreparedQuery.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clear()">clear</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Clears all cached queries.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code><a href="PreparedQuery.html" title="interface in org.apache.openjpa.kernel">PreparedQuery</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#get(java.lang.String)">get</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id)</code></th> |
| <td class="colLast"> |
| <div class="block">Get the PreparedQuery with the given identifier if it exists. null |
| otherwise.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getEnableStatistics()">getEnableStatistics</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Affirm if statistics is gathered.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="PreparedQueryCache.Exclusion.html" title="interface in org.apache.openjpa.kernel">PreparedQueryCache.Exclusion</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getExcludes()">getExcludes</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Gets the exclusion patterns.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,​<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMapView()">getMapView</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Get a map view of the cached queries indexed by identifier.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code><a href="QueryStatistics.html" title="interface in org.apache.openjpa.kernel">QueryStatistics</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getStatistics()">getStatistics</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Gets the simple statistics for executed queries.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code><a href="PreparedQuery.html" title="interface in org.apache.openjpa.kernel">PreparedQuery</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#initialize(java.lang.String,java.lang.Object)">initialize</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> key, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> executionResult)</code></th> |
| <td class="colLast"> |
| <div class="block">Initialize the cached Prepared Query registered with the given |
| key earlier by the given execution result.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#invalidate(java.lang.String)">invalidate</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id)</code></th> |
| <td class="colLast"> |
| <div class="block">Remove the PreparedQuery with the given identifier from this cache.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang" class="externalLink">Boolean</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isCachable(java.lang.String)">isCachable</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id)</code></th> |
| <td class="colLast"> |
| <div class="block">Affirms if a PreparedQuery can be cached against the given key.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code><a href="PreparedQueryCache.Exclusion.html" title="interface in org.apache.openjpa.kernel">PreparedQueryCache.Exclusion</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isExcluded(java.lang.String)">isExcluded</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the exclusion status of if the given query key.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code><a href="PreparedQuery.html" title="interface in org.apache.openjpa.kernel">PreparedQuery</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#markUncachable(java.lang.String,org.apache.openjpa.kernel.PreparedQueryCache.Exclusion)">markUncachable</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id, |
| <a href="PreparedQueryCache.Exclusion.html" title="interface in org.apache.openjpa.kernel">PreparedQueryCache.Exclusion</a> exclusion)</code></th> |
| <td class="colLast"> |
| <div class="block">Marks the given key as not amenable to caching.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang" class="externalLink">Boolean</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#register(java.lang.String,org.apache.openjpa.kernel.Query,org.apache.openjpa.kernel.FetchConfiguration)">register</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> key, |
| <a href="Query.html" title="interface in org.apache.openjpa.kernel">Query</a> query, |
| <a href="FetchConfiguration.html" title="interface in org.apache.openjpa.kernel">FetchConfiguration</a> hints)</code></th> |
| <td class="colLast"> |
| <div class="block">Register the given query for caching against the given key if it has not |
| already been cached.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeExclusionPattern(java.lang.String)">removeExclusionPattern</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> pattern)</code></th> |
| <td class="colLast"> |
| <div class="block">Removes the given pattern from the list of excluded patterns.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setEnableStatistics(boolean)">setEnableStatistics</a></span>​(boolean enable)</code></th> |
| <td class="colLast"> |
| <div class="block">Enable/disable gathering of statistics.</div> |
| </td> |
| </tr> |
| <tr id="i16" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setExcludes(java.lang.String)">setExcludes</a></span>​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> excludes)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets one or more exclusion regular expression patterns separated by |
| semicolon.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.org.apache.openjpa.lib.conf.Configurable"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.openjpa.lib.conf.<a href="../lib/conf/Configurable.html" title="interface in org.apache.openjpa.lib.conf">Configurable</a></h3> |
| <code><a href="../lib/conf/Configurable.html#endConfiguration()">endConfiguration</a>, <a href="../lib/conf/Configurable.html#setConfiguration(org.apache.openjpa.lib.conf.Configuration)">setConfiguration</a>, <a href="../lib/conf/Configurable.html#startConfiguration()">startConfiguration</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="register(java.lang.String,org.apache.openjpa.kernel.Query,org.apache.openjpa.kernel.FetchConfiguration)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>register</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang" class="externalLink">Boolean</a> register​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> key, |
| <a href="Query.html" title="interface in org.apache.openjpa.kernel">Query</a> query, |
| <a href="FetchConfiguration.html" title="interface in org.apache.openjpa.kernel">FetchConfiguration</a> hints)</pre> |
| <div class="block">Register the given query for caching against the given key if it has not |
| already been cached. If the query can not be cached, then mark it as such |
| to avoid computing for the same key again.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>TRUE the query is registered in the cache by this call |
| null if the query is already registered in the cache |
| FALSE if can not be registered in the cache, either because |
| it is known not to be cacheable from a previous attempt or |
| a hint is given to ignore the cached version.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="initialize(java.lang.String,java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>initialize</h4> |
| <pre class="methodSignature"><a href="PreparedQuery.html" title="interface in org.apache.openjpa.kernel">PreparedQuery</a> initialize​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> key, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> executionResult)</pre> |
| <div class="block">Initialize the cached Prepared Query registered with the given |
| key earlier by the given execution result. If it is not possible to |
| initialize the Prepared Query from the given execution result, then |
| the corresponding key will be marked as invalid for caching.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>key</code> - the key used during registration</dd> |
| <dd><code>executionResult</code> - an opaque instance carrying the execution result |
| of the original query.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the initialized Prepared Query. If it is not possible to |
| initialize the cached, possibly hollow Prepared Query from the given |
| result, return null.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getMapView()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getMapView</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>,​<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>> getMapView()</pre> |
| <div class="block">Get a map view of the cached queries indexed by identifier.</div> |
| </li> |
| </ul> |
| <a id="cache(org.apache.openjpa.kernel.PreparedQuery)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>cache</h4> |
| <pre class="methodSignature">boolean cache​(<a href="PreparedQuery.html" title="interface in org.apache.openjpa.kernel">PreparedQuery</a> q)</pre> |
| <div class="block">Cache the given PreparedQuery. |
| The key is the identifier of the given PreparedQuery itself. |
| The query must not be cached if either the key matches any exclusion |
| pattern or the key has been marked non-cachable.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if the given query is cached. false if it can not be cached |
| due to exclusion.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><code>#markUncachable(String)</code>, |
| <a href="#setExcludes(java.lang.String)"><code>setExcludes(String)</code></a>, |
| <a href="#addExclusionPattern(java.lang.String)"><code>addExclusionPattern(String)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="invalidate(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>invalidate</h4> |
| <pre class="methodSignature">boolean invalidate​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id)</pre> |
| <div class="block">Remove the PreparedQuery with the given identifier from this cache.</div> |
| </li> |
| </ul> |
| <a id="get(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>get</h4> |
| <pre class="methodSignature"><a href="PreparedQuery.html" title="interface in org.apache.openjpa.kernel">PreparedQuery</a> get​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id)</pre> |
| <div class="block">Get the PreparedQuery with the given identifier if it exists. null |
| otherwise.</div> |
| </li> |
| </ul> |
| <a id="isCachable(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isCachable</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Boolean.html?is-external=true" title="class or interface in java.lang" class="externalLink">Boolean</a> isCachable​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id)</pre> |
| <div class="block">Affirms if a PreparedQuery can be cached against the given key.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Boolean.FALSE if the given key is explicitly marked before as not |
| be cached or matches any of the exclusion patterns. |
| Boolean.TRUE if the given key currently exists in the cache. |
| Otherwise, return null implying this receiver can not determine whether |
| this key can be cached on not.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="markUncachable(java.lang.String,org.apache.openjpa.kernel.PreparedQueryCache.Exclusion)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>markUncachable</h4> |
| <pre class="methodSignature"><a href="PreparedQuery.html" title="interface in org.apache.openjpa.kernel">PreparedQuery</a> markUncachable​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id, |
| <a href="PreparedQueryCache.Exclusion.html" title="interface in org.apache.openjpa.kernel">PreparedQueryCache.Exclusion</a> exclusion)</pre> |
| <div class="block">Marks the given key as not amenable to caching. |
| Explicit marking helps to avoid repeated computational cost of |
| determining whether a query can be cached or not.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>id</code> - is the key to be excluded</dd> |
| <dd><code>exclusion</code> - directs whether exclusion is irreversible or not.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The value for the given key if it had been cached before. null |
| otherwise.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isExcluded(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isExcluded</h4> |
| <pre class="methodSignature"><a href="PreparedQueryCache.Exclusion.html" title="interface in org.apache.openjpa.kernel">PreparedQueryCache.Exclusion</a> isExcluded​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> id)</pre> |
| <div class="block">Returns the exclusion status of if the given query key.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>null implies that the key is not excluded.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getExcludes()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getExcludes</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="PreparedQueryCache.Exclusion.html" title="interface in org.apache.openjpa.kernel">PreparedQueryCache.Exclusion</a>> getExcludes()</pre> |
| <div class="block">Gets the exclusion patterns.</div> |
| </li> |
| </ul> |
| <a id="setExcludes(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setExcludes</h4> |
| <pre class="methodSignature">void setExcludes​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> excludes)</pre> |
| <div class="block">Sets one or more exclusion regular expression patterns separated by |
| semicolon. Any existing cache entry whose key matches any of the given |
| pattern will be marked non-cachable in a reversible manner.</div> |
| </li> |
| </ul> |
| <a id="addExclusionPattern(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>addExclusionPattern</h4> |
| <pre class="methodSignature">void addExclusionPattern​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> pattern)</pre> |
| <div class="block">Adds the given pattern to the list of excluded patterns. Any existing |
| cache entry whose key matches the given pattern will be marked |
| non-cachable in a reversible manner.</div> |
| </li> |
| </ul> |
| <a id="removeExclusionPattern(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>removeExclusionPattern</h4> |
| <pre class="methodSignature">void removeExclusionPattern​(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> pattern)</pre> |
| <div class="block">Removes the given pattern from the list of excluded patterns. |
| Any excluded key that matches the given pattern can now be cached |
| again, unless it has been marked non-cachable explicitly.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#markUncachable(java.lang.String,org.apache.openjpa.kernel.PreparedQueryCache.Exclusion)"><code>markUncachable(String, Exclusion)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="clear()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>clear</h4> |
| <pre class="methodSignature">void clear()</pre> |
| <div class="block">Clears all cached queries.</div> |
| </li> |
| </ul> |
| <a id="setEnableStatistics(boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setEnableStatistics</h4> |
| <pre class="methodSignature">void setEnableStatistics​(boolean enable)</pre> |
| <div class="block">Enable/disable gathering of statistics.</div> |
| </li> |
| </ul> |
| <a id="getEnableStatistics()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getEnableStatistics</h4> |
| <pre class="methodSignature">boolean getEnableStatistics()</pre> |
| <div class="block">Affirm if statistics is gathered.</div> |
| </li> |
| </ul> |
| <a id="getStatistics()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>getStatistics</h4> |
| <pre class="methodSignature"><a href="QueryStatistics.html" title="interface in org.apache.openjpa.kernel">QueryStatistics</a><<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>> getStatistics()</pre> |
| <div class="block">Gets the simple statistics for executed queries. |
| If the statistics gathering is disabled, an empty statistics is returned.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/PreparedQueryCache.html">Use</a></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> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All 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> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2006–2025 <a href="http://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |