mirror of
https://github.com/yasuhirokimura/db18
synced 2026-06-08 18:29:23 +00:00
1087 lines
60 KiB
HTML
1087 lines
60 KiB
HTML
<!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 (11.0.7) on Mon Jun 01 06:40:53 PDT 2020 -->
|
|
<title>EntityStore (Oracle - Berkeley DB Java API)</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta name="date" content="2020-06-01">
|
|
<link rel="stylesheet" type="text/css" href="../../../style.css" title="Style">
|
|
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.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.4.1.js"></script>
|
|
<script type="text/javascript" src="../../../jquery/jquery-ui.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
try {
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="EntityStore (Oracle - Berkeley DB Java API)";
|
|
}
|
|
}
|
|
catch(err) {
|
|
}
|
|
//-->
|
|
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10};
|
|
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete 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>
|
|
<div class="fixedNav">
|
|
<!-- ========= 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="../../../index.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/EntityStore.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 class="aboutLanguage"><b>Berkeley DB</b><br><font size="-1"> version 18.1.40</font></div>
|
|
</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>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="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>
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">com.sleepycat.persist</a></div>
|
|
<h2 title="Class EntityStore" class="title">Class EntityStore</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li>java.lang.Object</li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>com.sleepycat.persist.EntityStore</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<hr>
|
|
<pre>public class <span class="typeNameLabel">EntityStore</span>
|
|
extends java.lang.Object</pre>
|
|
<div class="block">A store for managing persistent entity objects.
|
|
|
|
<p><code>EntityStore</code> objects are thread-safe. Multiple threads may safely
|
|
call the methods of a shared <code>EntityStore</code> object.</p>
|
|
|
|
<p>See the <a href="package-summary.html#example">package
|
|
summary example</a> for an example of using an <code>EntityStore</code>.</p>
|
|
|
|
<p>Before creating an <code>EntityStore</code> you must create an <a href="../db/Environment.html" title="class in com.sleepycat.db"><code>Environment</code></a> object using the Berkeley DB engine API. The environment may
|
|
contain any number of entity stores and their associated databases, as well
|
|
as other databases not associated with an entity store.</p>
|
|
|
|
<p>An entity store is based on an <a href="model/EntityModel.html" title="class in com.sleepycat.persist.model"><code>EntityModel</code></a>: a data model which
|
|
defines persistent classes (<em>entity classes</em>), primary keys,
|
|
secondary keys, and relationships between entities. A primary index is
|
|
created for each entity class. An associated secondary index is created for
|
|
each secondary key. The <a href="model/Entity.html" title="annotation in com.sleepycat.persist.model"><code>Entity</code></a>, <a href="model/PrimaryKey.html" title="annotation in com.sleepycat.persist.model"><code>PrimaryKey</code></a> and <a href="model/SecondaryKey.html" title="annotation in com.sleepycat.persist.model"><code>SecondaryKey</code></a> annotations may be used to define entities and keys.</p>
|
|
|
|
<p>To use an <code>EntityStore</code>, first obtain <a href="PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and
|
|
<a href="SecondaryIndex.html" title="class in com.sleepycat.persist"><code>SecondaryIndex</code></a> objects by calling <a href="#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex</code></a> and <a href="#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex</code></a>. Then use
|
|
these indices to store and access entity records by key.</p>
|
|
|
|
<p>Although not normally needed, you can also use the entity store along
|
|
with the <a href="../db/package-summary.html"><code>Base API</code></a>. Methods in the <a href="PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and <a href="SecondaryIndex.html" title="class in com.sleepycat.persist"><code>SecondaryIndex</code></a> classes may be used to obtain
|
|
databases and bindings. The databases may be used directly for accessing
|
|
entity records. The bindings should be called explicitly to translate
|
|
between <a href="../db/DatabaseEntry.html" title="class in com.sleepycat.db"><code>DatabaseEntry</code></a> objects and entity model
|
|
objects.</p>
|
|
|
|
<p>Each primary and secondary index is associated internally with a <a href="../db/Database.html" title="class in com.sleepycat.db"><code>Database</code></a>. With any of the above mentioned use cases, methods are provided
|
|
that may be used for database performance tuning. The <a href="#setPrimaryConfig-java.lang.Class-com.sleepycat.db.DatabaseConfig-"><code>setPrimaryConfig</code></a> and <a href="#setSecondaryConfig-java.lang.Class-java.lang.String-com.sleepycat.db.SecondaryConfig-"><code>setSecondaryConfig</code></a> methods may be called anytime before a database is
|
|
opened via <a href="#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex</code></a> or <a href="#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex</code></a>. The <a href="#setSequenceConfig-java.lang.String-com.sleepycat.db.SequenceConfig-"><code>setSequenceConfig</code></a> method may be called anytime before <a href="#getSequence-java.lang.String-"><code>getSequence</code></a> is called or <a href="#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex</code></a> is called
|
|
for a primary index associated with that sequence.</p></div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Summary</h3>
|
|
<table class="memberSummary" summary="Constructor Summary table, listing constructors, and an explanation">
|
|
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Constructor</th>
|
|
<th class="colLast" scope="col">Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#EntityStore-com.sleepycat.db.Environment-java.lang.String-com.sleepycat.persist.StoreConfig-">EntityStore</a></span>​(<a href="../db/Environment.html" title="class in com.sleepycat.db">Environment</a> env,
|
|
java.lang.String storeName,
|
|
<a href="StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</a> config)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Opens an entity store in a given environment.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Summary</h3>
|
|
<table class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
|
|
<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="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete 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="#close--">close</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Closes all databases and sequences that were opened via this store.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i1" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#closeClass-java.lang.Class-">closeClass</a></span>​(java.lang.Class entityClass)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Closes the primary and secondary databases for the given entity class
|
|
that were opened via this store.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i2" class="altColor">
|
|
<td class="colFirst"><code><a href="evolve/EvolveStats.html" title="class in com.sleepycat.persist.evolve">EvolveStats</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#evolve-com.sleepycat.persist.evolve.EvolveConfig-">evolve</a></span>​(<a href="evolve/EvolveConfig.html" title="class in com.sleepycat.persist.evolve">EvolveConfig</a> config)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Performs conversion of unevolved objects in order to reduce lazy
|
|
conversion overhead.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i3" class="rowColor">
|
|
<td class="colFirst"><code><a href="StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getConfig--">getConfig</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns a copy of the entity store configuration.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i4" class="altColor">
|
|
<td class="colFirst"><code><a href="../db/Environment.html" title="class in com.sleepycat.db">Environment</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getEnvironment--">getEnvironment</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the environment associated with this store.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i5" class="rowColor">
|
|
<td class="colFirst"><code><a href="model/EntityModel.html" title="class in com.sleepycat.persist.model">EntityModel</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getModel--">getModel</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the current entity model for this store.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i6" class="altColor">
|
|
<td class="colFirst"><code><a href="evolve/Mutations.html" title="class in com.sleepycat.persist.evolve">Mutations</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMutations--">getMutations</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the set of mutations that were configured when the store was
|
|
opened, or if none were configured, the set of mutations that were
|
|
configured and stored previously.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i7" class="rowColor">
|
|
<td class="colFirst"><code><a href="../db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPrimaryConfig-java.lang.Class-">getPrimaryConfig</a></span>​(java.lang.Class entityClass)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the default primary database Berkeley DB engine API
|
|
configuration for an entity class.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i8" class="altColor">
|
|
<td class="colFirst"><code><PK,​E><br><a href="PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a><PK,​E></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPrimaryIndex-java.lang.Class-java.lang.Class-">getPrimaryIndex</a></span>​(java.lang.Class<PK> primaryKeyClass,
|
|
java.lang.Class<E> entityClass)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the primary index for a given entity class, opening it if
|
|
necessary.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i9" class="rowColor">
|
|
<td class="colFirst"><code><a href="../db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSecondaryConfig-java.lang.Class-java.lang.String-">getSecondaryConfig</a></span>​(java.lang.Class entityClass,
|
|
java.lang.String keyName)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the default secondary database Berkeley DB engine API
|
|
configuration for an entity class and key name.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i10" class="altColor">
|
|
<td class="colFirst"><code><SK,​PK,​E><br><a href="SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</a><SK,​PK,​E></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-">getSecondaryIndex</a></span>​(<a href="PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a><PK,​E> primaryIndex,
|
|
java.lang.Class<SK> keyClass,
|
|
java.lang.String keyName)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns a secondary index for a given primary index and secondary key,
|
|
opening it if necessary.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i11" class="rowColor">
|
|
<td class="colFirst"><code><a href="../db/Sequence.html" title="class in com.sleepycat.db">Sequence</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSequence-java.lang.String-">getSequence</a></span>​(java.lang.String name)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns a named sequence for using Berkeley DB engine API directly,
|
|
opening it if necessary.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i12" class="altColor">
|
|
<td class="colFirst"><code><a href="../db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</a></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSequenceConfig-java.lang.String-">getSequenceConfig</a></span>​(java.lang.String name)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the default Berkeley DB engine API configuration for a named key
|
|
sequence.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i13" class="rowColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getStoreName--">getStoreName</a></span>()</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns the name of this store.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i14" class="altColor">
|
|
<td class="colFirst"><code><SK,​PK,​E1,​E2 extends E1><br><a href="SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</a><SK,​PK,​E2></code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSubclassIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.Class-java.lang.String-">getSubclassIndex</a></span>​(<a href="PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a><PK,​E1> primaryIndex,
|
|
java.lang.Class<E2> entitySubclass,
|
|
java.lang.Class<SK> keyClass,
|
|
java.lang.String keyName)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Returns a secondary index for a secondary key in an entity subclass,
|
|
opening it if necessary.</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="#setPrimaryConfig-java.lang.Class-com.sleepycat.db.DatabaseConfig-">setPrimaryConfig</a></span>​(java.lang.Class entityClass,
|
|
<a href="../db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</a> config)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Configures the primary database for an entity class using the Berkeley
|
|
DB engine API.</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="#setSecondaryConfig-java.lang.Class-java.lang.String-com.sleepycat.db.SecondaryConfig-">setSecondaryConfig</a></span>​(java.lang.Class entityClass,
|
|
java.lang.String keyName,
|
|
<a href="../db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</a> config)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Configures a secondary database for an entity class and key name using
|
|
the Berkeley DB engine API.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i17" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSequenceConfig-java.lang.String-com.sleepycat.db.SequenceConfig-">setSequenceConfig</a></span>​(java.lang.String name,
|
|
<a href="../db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</a> config)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Configures a named key sequence using the Berkeley DB engine API.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i18" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#truncateClass-com.sleepycat.db.Transaction-java.lang.Class-">truncateClass</a></span>​(<a href="../db/Transaction.html" title="class in com.sleepycat.db">Transaction</a> txn,
|
|
java.lang.Class entityClass)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Deletes all instances of this entity class and its (non-entity)
|
|
subclasses.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i19" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#truncateClass-java.lang.Class-">truncateClass</a></span>​(java.lang.Class entityClass)</code></th>
|
|
<td class="colLast">
|
|
<div class="block">Deletes all instances of this entity class and its (non-entity)
|
|
subclasses.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class java.lang.Object</h3>
|
|
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Detail</h3>
|
|
<a name="EntityStore-com.sleepycat.db.Environment-java.lang.String-com.sleepycat.persist.StoreConfig-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>EntityStore</h4>
|
|
<pre>public EntityStore​(<a href="../db/Environment.html" title="class in com.sleepycat.db">Environment</a> env,
|
|
java.lang.String storeName,
|
|
<a href="StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</a> config)
|
|
throws <a href="StoreExistsException.html" title="class in com.sleepycat.persist">StoreExistsException</a>,
|
|
<a href="StoreNotFoundException.html" title="class in com.sleepycat.persist">StoreNotFoundException</a>,
|
|
<a href="evolve/IncompatibleClassException.html" title="class in com.sleepycat.persist.evolve">IncompatibleClassException</a>,
|
|
<a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Opens an entity store in a given environment.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>env</code> - an open Berkeley DB Environment.</dd>
|
|
<dd><code>storeName</code> - the name of the entity store within the given
|
|
environment. An empty string is allowed. Named stores may be used to
|
|
distinguish multiple sets of persistent entities for the same entity
|
|
classes in a single environment. Underlying database names are prefixed
|
|
with the store name.</dd>
|
|
<dd><code>config</code> - the entity store configuration, or null to use default
|
|
configuration properties.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="StoreExistsException.html" title="class in com.sleepycat.persist">StoreExistsException</a></code> - when the <a href="StoreConfig.html#setExclusiveCreate-boolean-"><code>ExclusiveCreate</code></a> configuration parameter
|
|
is true and the store's internal catalog database already exists.</dd>
|
|
<dd><code><a href="StoreNotFoundException.html" title="class in com.sleepycat.persist">StoreNotFoundException</a></code> - when when the <a href="StoreConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> configuration parameter is false
|
|
and the store's internal catalog database does not exist.</dd>
|
|
<dd><code><a href="evolve/IncompatibleClassException.html" title="class in com.sleepycat.persist.evolve">IncompatibleClassException</a></code> - if an incompatible class change has
|
|
been made and mutations are not configured for handling the change. See
|
|
<a href="evolve/package-summary.html"><code>Class Evolution</code></a> for more
|
|
information.</dd>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a name="getEnvironment--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getEnvironment</h4>
|
|
<pre class="methodSignature">public <a href="../db/Environment.html" title="class in com.sleepycat.db">Environment</a> getEnvironment()</pre>
|
|
<div class="block">Returns the environment associated with this store.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the environment.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getConfig--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getConfig</h4>
|
|
<pre class="methodSignature">public <a href="StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</a> getConfig()</pre>
|
|
<div class="block">Returns a copy of the entity store configuration.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the config.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getStoreName--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getStoreName</h4>
|
|
<pre class="methodSignature">public java.lang.String getStoreName()</pre>
|
|
<div class="block">Returns the name of this store.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the name.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getModel--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getModel</h4>
|
|
<pre class="methodSignature">public <a href="model/EntityModel.html" title="class in com.sleepycat.persist.model">EntityModel</a> getModel()</pre>
|
|
<div class="block">Returns the current entity model for this store. The current model is
|
|
derived from the configured entity model and the live entity class
|
|
definitions.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the model.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getMutations--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getMutations</h4>
|
|
<pre class="methodSignature">public <a href="evolve/Mutations.html" title="class in com.sleepycat.persist.evolve">Mutations</a> getMutations()</pre>
|
|
<div class="block">Returns the set of mutations that were configured when the store was
|
|
opened, or if none were configured, the set of mutations that were
|
|
configured and stored previously.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the mutations.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getPrimaryIndex-java.lang.Class-java.lang.Class-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getPrimaryIndex</h4>
|
|
<pre class="methodSignature">public <PK,​E> <a href="PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a><PK,​E> getPrimaryIndex​(java.lang.Class<PK> primaryKeyClass,
|
|
java.lang.Class<E> entityClass)
|
|
throws <a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Returns the primary index for a given entity class, opening it if
|
|
necessary.
|
|
|
|
<p>If they are not already open, the primary and secondary databases for
|
|
the entity class are created/opened together in a single internal
|
|
transaction. When the secondary indices are opened, that can cascade to
|
|
open other related primary indices.</p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Type Parameters:</span></dt>
|
|
<dd><code>PK</code> - the primary key class.</dd>
|
|
<dd><code>E</code> - the entity class.</dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>primaryKeyClass</code> - the class of the entity's primary key field, or
|
|
the corresponding primitive wrapper class if the primary key field type
|
|
is a primitive.</dd>
|
|
<dd><code>entityClass</code> - the entity class for which to open the primary index.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the primary index.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.IllegalArgumentException</code> - if the entity class or classes
|
|
referenced by it are not persistent, or the primary key class does not
|
|
match the entity's primary key field, or if metadata for the entity or
|
|
primary key is invalid.</dd>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getSecondaryIndex</h4>
|
|
<pre class="methodSignature">public <SK,​PK,​E> <a href="SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</a><SK,​PK,​E> getSecondaryIndex​(<a href="PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a><PK,​E> primaryIndex,
|
|
java.lang.Class<SK> keyClass,
|
|
java.lang.String keyName)
|
|
throws <a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Returns a secondary index for a given primary index and secondary key,
|
|
opening it if necessary.
|
|
|
|
<p><em>NOTE:</em> If the secondary key field is declared in a subclass
|
|
of the entity class, use <a href="#getSubclassIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.Class-java.lang.String-"><code>getSubclassIndex(com.sleepycat.persist.PrimaryIndex<PK, E1>, java.lang.Class<E2>, java.lang.Class<SK>, java.lang.String)</code></a> instead.</p>
|
|
|
|
<p>If a <a href="model/SecondaryKey.html#relatedEntity--"><code>SecondaryKey.relatedEntity()</code></a> is used and the primary index
|
|
for the related entity is not already open, it will be opened by this
|
|
method. That will, in turn, open its secondary indices, which can
|
|
cascade to open other primary indices.</p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Type Parameters:</span></dt>
|
|
<dd><code>SK</code> - the secondary key class.</dd>
|
|
<dd><code>PK</code> - the primary key class.</dd>
|
|
<dd><code>E</code> - the entity class.</dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>primaryIndex</code> - the primary index associated with the returned
|
|
secondary index. The entity class of the primary index, or one of its
|
|
superclasses, must contain a secondary key with the given secondary key
|
|
class and key name.</dd>
|
|
<dd><code>keyClass</code> - the class of the secondary key field, or the
|
|
corresponding primitive wrapper class if the secondary key field type is
|
|
a primitive.</dd>
|
|
<dd><code>keyName</code> - the name of the secondary key field, or the <a href="model/SecondaryKey.html#name--"><code>SecondaryKey.name()</code></a> if this name annotation property was specified.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the secondary index.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.IllegalArgumentException</code> - if the entity class or one of its
|
|
superclasses does not contain a key field of the given key class and key
|
|
name, or if the metadata for the secondary key is invalid.</dd>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getSubclassIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.Class-java.lang.String-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getSubclassIndex</h4>
|
|
<pre class="methodSignature">public <SK,​PK,​E1,​E2 extends E1> <a href="SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</a><SK,​PK,​E2> getSubclassIndex​(<a href="PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a><PK,​E1> primaryIndex,
|
|
java.lang.Class<E2> entitySubclass,
|
|
java.lang.Class<SK> keyClass,
|
|
java.lang.String keyName)
|
|
throws <a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Returns a secondary index for a secondary key in an entity subclass,
|
|
opening it if necessary.
|
|
|
|
<p>If a <a href="model/SecondaryKey.html#relatedEntity--"><code>SecondaryKey.relatedEntity()</code></a> is used and the primary index
|
|
for the related entity is not already open, it will be opened by this
|
|
method. That will, in turn, open its secondary indices, which can
|
|
cascade to open other primary indices.</p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Type Parameters:</span></dt>
|
|
<dd><code>SK</code> - the secondary key class.</dd>
|
|
<dd><code>PK</code> - the primary key class.</dd>
|
|
<dd><code>E1</code> - the entity class.</dd>
|
|
<dd><code>E2</code> - the entity sub-class.</dd>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>primaryIndex</code> - the primary index associated with the returned
|
|
secondary index. The entity class of the primary index, or one of its
|
|
superclasses, must contain a secondary key with the given secondary key
|
|
class and key name.</dd>
|
|
<dd><code>entitySubclass</code> - a subclass of the entity class for the primary
|
|
index. The entity subclass must contain a secondary key with the given
|
|
secondary key class and key name.</dd>
|
|
<dd><code>keyClass</code> - the class of the secondary key field, or the
|
|
corresponding primitive wrapper class if the secondary key field type is
|
|
a primitive.</dd>
|
|
<dd><code>keyName</code> - the name of the secondary key field, or the <a href="model/SecondaryKey.html#name--"><code>SecondaryKey.name()</code></a> if this name annotation property was specified.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the secondary index.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.IllegalArgumentException</code> - if the given entity subclass does not
|
|
contain a key field of the given key class and key name, or if the
|
|
metadata for the secondary key is invalid.</dd>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="evolve-com.sleepycat.persist.evolve.EvolveConfig-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>evolve</h4>
|
|
<pre class="methodSignature">public <a href="evolve/EvolveStats.html" title="class in com.sleepycat.persist.evolve">EvolveStats</a> evolve​(<a href="evolve/EvolveConfig.html" title="class in com.sleepycat.persist.evolve">EvolveConfig</a> config)
|
|
throws <a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Performs conversion of unevolved objects in order to reduce lazy
|
|
conversion overhead. Evolution may be performed concurrently with
|
|
normal access to the store.
|
|
|
|
<p>Conversion is performed one entity class at a time. An entity class
|
|
is converted only if it has <a href="evolve/Mutations.html" title="class in com.sleepycat.persist.evolve"><code>Mutations</code></a> associated with it via
|
|
<a href="StoreConfig.html#setMutations-com.sleepycat.persist.evolve.Mutations-"><code>StoreConfig.setMutations</code></a>.</p>
|
|
|
|
<p>Conversion of an entity class is performed by reading each entity,
|
|
converting it if necessary, and updating it if conversion was performed.
|
|
When all instances of an entity class are converted, references to the
|
|
appropriate <a href="evolve/Mutations.html" title="class in com.sleepycat.persist.evolve"><code>Mutations</code></a> are deleted. Therefore, if this method is
|
|
called twice successfully without changing class definitions, the second
|
|
call will do nothing.</p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>config</code> - the EvolveConfig.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the EvolveStats.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="evolve/package-summary.html"><code>Class Evolution</code></a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="truncateClass-java.lang.Class-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>truncateClass</h4>
|
|
<pre class="methodSignature">public void truncateClass​(java.lang.Class entityClass)
|
|
throws <a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Deletes all instances of this entity class and its (non-entity)
|
|
subclasses.
|
|
|
|
<p>The primary database for the given entity class will be truncated and
|
|
all secondary databases will be removed. The primary and secondary
|
|
databases associated with the entity class must not be open except by
|
|
this store, since database truncation/removal is only possible when the
|
|
database is not open.</p>
|
|
|
|
<p>The primary and secondary databases for the entity class will be
|
|
closed by this operation and the existing <a href="PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and
|
|
<a href="SecondaryIndex.html" title="class in com.sleepycat.persist"><code>SecondaryIndex</code></a> objects will be invalidated. To access the
|
|
indexes, the user must call <a href="#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex(java.lang.Class<PK>, java.lang.Class<E>)</code></a> and <a href="#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex(com.sleepycat.persist.PrimaryIndex<PK, E>, java.lang.Class<SK>, java.lang.String)</code></a> after this operation is complete.</p>
|
|
|
|
<p>Auto-commit is used implicitly if the store is transactional.</p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>entityClass</code> - the entity class whose instances are to be deleted.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="truncateClass-com.sleepycat.db.Transaction-java.lang.Class-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>truncateClass</h4>
|
|
<pre class="methodSignature">public void truncateClass​(<a href="../db/Transaction.html" title="class in com.sleepycat.db">Transaction</a> txn,
|
|
java.lang.Class entityClass)
|
|
throws <a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Deletes all instances of this entity class and its (non-entity)
|
|
subclasses.
|
|
|
|
<p>The primary database for the given entity class will be truncated and
|
|
all secondary databases will be removed. The primary and secondary
|
|
databases associated with the entity class must not be open except by
|
|
this store, since database truncation/removal is only possible when the
|
|
database is not open.</p>
|
|
|
|
<p>The primary and secondary databases for the entity class will be
|
|
closed by this operation and the existing <a href="PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and
|
|
<a href="SecondaryIndex.html" title="class in com.sleepycat.persist"><code>SecondaryIndex</code></a> objects will be invalidated. To access the
|
|
indexes, the user must call <a href="#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex(java.lang.Class<PK>, java.lang.Class<E>)</code></a> and <a href="#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex(com.sleepycat.persist.PrimaryIndex<PK, E>, java.lang.Class<SK>, java.lang.String)</code></a> after this operation is complete.</p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>txn</code> - the transaction used to protect this operation, null to use
|
|
auto-commit, or null if the store is non-transactional.</dd>
|
|
<dd><code>entityClass</code> - the entity class whose instances are to be deleted.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="closeClass-java.lang.Class-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>closeClass</h4>
|
|
<pre class="methodSignature">public void closeClass​(java.lang.Class entityClass)
|
|
throws <a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Closes the primary and secondary databases for the given entity class
|
|
that were opened via this store. The caller must ensure that the
|
|
primary and secondary indices for the entity class are no longer in
|
|
use.
|
|
|
|
<p>The primary and secondary databases for the entity class will be
|
|
closed by this operation and the existing <a href="PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and
|
|
<a href="SecondaryIndex.html" title="class in com.sleepycat.persist"><code>SecondaryIndex</code></a> objects will be invalidated. To access the
|
|
indexes, the user must call <a href="#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex(java.lang.Class<PK>, java.lang.Class<E>)</code></a> and <a href="#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex(com.sleepycat.persist.PrimaryIndex<PK, E>, java.lang.Class<SK>, java.lang.String)</code></a> after this operation is complete.</p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>entityClass</code> - the entity class whose databases are to be closed.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="close--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>close</h4>
|
|
<pre class="methodSignature">public void close()
|
|
throws <a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Closes all databases and sequences that were opened via this store. The
|
|
caller must ensure that no databases opened via this store are in use.
|
|
|
|
|
|
<p>WARNING: To guard against memory leaks, the application should
|
|
discard all references to the closed handle. While BDB makes an effort
|
|
to discard references from closed objects to the allocated memory for an
|
|
environment, this behavior is not guaranteed. The safe course of action
|
|
for an application is to discard all references to closed BDB
|
|
objects.</p></div>
|
|
<dl>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getSequence-java.lang.String-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getSequence</h4>
|
|
<pre class="methodSignature">public <a href="../db/Sequence.html" title="class in com.sleepycat.db">Sequence</a> getSequence​(java.lang.String name)
|
|
throws <a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></pre>
|
|
<div class="block">Returns a named sequence for using Berkeley DB engine API directly,
|
|
opening it if necessary.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>name</code> - the sequence name, which is normally defined using the
|
|
<a href="model/PrimaryKey.html#sequence--"><code>PrimaryKey.sequence()</code></a> annotation property.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the open sequence for the given sequence name.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getSequenceConfig-java.lang.String-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getSequenceConfig</h4>
|
|
<pre class="methodSignature">public <a href="../db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</a> getSequenceConfig​(java.lang.String name)</pre>
|
|
<div class="block">Returns the default Berkeley DB engine API configuration for a named key
|
|
sequence.
|
|
|
|
<p>The returned configuration is as follows. All other properties have
|
|
default values.</p>
|
|
<ul>
|
|
<li>The <a href="../db/SequenceConfig.html#setInitialValue-long-"><code>InitialValue</code></a> is one.</li>
|
|
<li>The <a href="../db/SequenceConfig.html#setRange-long-long-"><code>Range</code></a> minimum is one.</li>
|
|
<li>The <a href="../db/SequenceConfig.html#setCacheSize-int-"><code>CacheSize</code></a> is 100.</li>
|
|
<li><a href="../db/SequenceConfig.html#setAutoCommitNoSync-boolean-"><code>AutoCommitNoSync</code></a> is
|
|
true.</li>
|
|
<li><a href="../db/SequenceConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> is set to the
|
|
inverse of the store <a href="StoreConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a>.
|
|
setting.</li>
|
|
</ul></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>name</code> - the sequence name, which is normally defined using the
|
|
<a href="model/PrimaryKey.html#sequence--"><code>PrimaryKey.sequence()</code></a> annotation property.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the default configuration for the given sequence name.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="setSequenceConfig-java.lang.String-com.sleepycat.db.SequenceConfig-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setSequenceConfig</h4>
|
|
<pre class="methodSignature">public void setSequenceConfig​(java.lang.String name,
|
|
<a href="../db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</a> config)</pre>
|
|
<div class="block">Configures a named key sequence using the Berkeley DB engine API.
|
|
|
|
<p>To be compatible with the entity model and the Direct Persistence
|
|
Layer, the configuration should be retrieved using <a href="#getSequenceConfig-java.lang.String-"><code>getSequenceConfig</code></a>, modified, and then passed to this
|
|
method. The following configuration properties may not be changed:</p>
|
|
<ul>
|
|
<li><a href="../db/SequenceConfig.html#setExclusiveCreate-boolean-"><code>ExclusiveCreate</code></a></li>
|
|
</ul>
|
|
<p>In addition, <a href="../db/SequenceConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> must be
|
|
the inverse of <code>ReadOnly</code></p>
|
|
|
|
<p>If the range is changed to include the value zero, see <a href="model/PrimaryKey.html" title="annotation in com.sleepycat.persist.model"><code>PrimaryKey</code></a> for restrictions.</p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>name</code> - the sequence name, which is normally defined using the
|
|
<a href="model/PrimaryKey.html#sequence--"><code>PrimaryKey.sequence()</code></a> annotation property.</dd>
|
|
<dd><code>config</code> - the configuration to use for the given sequence name.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.IllegalArgumentException</code> - if the configuration is incompatible
|
|
with the entity model or the Direct Persistence Layer.</dd>
|
|
<dd><code>java.lang.IllegalStateException</code> - if the sequence has already been opened.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getPrimaryConfig-java.lang.Class-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getPrimaryConfig</h4>
|
|
<pre class="methodSignature">public <a href="../db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</a> getPrimaryConfig​(java.lang.Class entityClass)</pre>
|
|
<div class="block">Returns the default primary database Berkeley DB engine API
|
|
configuration for an entity class.
|
|
|
|
<p>The returned configuration is as follows. All other properties have
|
|
default values.</p>
|
|
<ul>
|
|
<li><a href="../db/DatabaseConfig.html#setTransactional-boolean-"><code>Transactional</code></a> is set to
|
|
match <a href="StoreConfig.html#setTransactional-boolean-"><code>StoreConfig</code></a>.</li>
|
|
<li><a href="../db/DatabaseConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> is set to the
|
|
inverse of the store <a href="StoreConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a>.
|
|
setting.</li>
|
|
<li><a href="../db/DatabaseConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a> is set to match
|
|
<a href="StoreConfig.html#setReadOnly-boolean-"><code>StoreConfig</code></a>.</li>
|
|
<li><a href="../db/DatabaseConfig.html#setBtreeComparator-java.util.Comparator-"><code>BtreeComparator</code></a> is set to
|
|
an internal class if a key comparator is used.</li>
|
|
</ul></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>entityClass</code> - the entity class identifying the primary database.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the default configuration for the given entity class.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="setPrimaryConfig-java.lang.Class-com.sleepycat.db.DatabaseConfig-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setPrimaryConfig</h4>
|
|
<pre class="methodSignature">public void setPrimaryConfig​(java.lang.Class entityClass,
|
|
<a href="../db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</a> config)</pre>
|
|
<div class="block">Configures the primary database for an entity class using the Berkeley
|
|
DB engine API.
|
|
|
|
<p>To be compatible with the entity model and the Direct Persistence
|
|
Layer, the configuration should be retrieved using <a href="#getPrimaryConfig-java.lang.Class-"><code>getPrimaryConfig</code></a>, modified, and then passed to this
|
|
method. The following configuration properties may not be changed:</p>
|
|
<ul>
|
|
<li><a href="../db/DatabaseConfig.html#setExclusiveCreate-boolean-"><code>ExclusiveCreate</code></a></li>
|
|
<li><a href="../db/DatabaseConfig.html#setSortedDuplicates-boolean-"><code>SortedDuplicates</code></a></li>
|
|
<li><a href="../db/DatabaseConfig.html#setBtreeComparator-java.util.Comparator-"><code>BtreeComparator</code></a></li>
|
|
</ul>
|
|
<p>In addition, <a href="../db/DatabaseConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> must be
|
|
the inverse of <code>ReadOnly</code></p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>entityClass</code> - the entity class identifying the primary database.</dd>
|
|
<dd><code>config</code> - the configuration to use for the given entity class.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.IllegalArgumentException</code> - if the configuration is incompatible
|
|
with the entity model or the Direct Persistence Layer.</dd>
|
|
<dd><code>java.lang.IllegalStateException</code> - if the database has already been opened.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getSecondaryConfig-java.lang.Class-java.lang.String-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getSecondaryConfig</h4>
|
|
<pre class="methodSignature">public <a href="../db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</a> getSecondaryConfig​(java.lang.Class entityClass,
|
|
java.lang.String keyName)</pre>
|
|
<div class="block">Returns the default secondary database Berkeley DB engine API
|
|
configuration for an entity class and key name.
|
|
|
|
<p>The returned configuration is as follows. All other properties have
|
|
default values.</p>
|
|
<ul>
|
|
<li><a href="../db/DatabaseConfig.html#setTransactional-boolean-"><code>Transactional</code></a> is set to
|
|
match the primary database.</li>
|
|
<li><a href="../db/DatabaseConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> is set to the
|
|
inverse of the primary database <a href="../db/DatabaseConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a> setting.</li>
|
|
<li><a href="../db/DatabaseConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a> is set to match
|
|
the primary database.</li>
|
|
<li><a href="../db/DatabaseConfig.html#setBtreeComparator-java.util.Comparator-"><code>BtreeComparator</code></a> is set to
|
|
an internal class if a key comparator is used.</li>
|
|
<li><a href="../db/DatabaseConfig.html#setSortedDuplicates-boolean-"><code>SortedDuplicates</code></a> is set
|
|
according to <a href="model/SecondaryKey.html#relate--"><code>SecondaryKey.relate()</code></a>.</li>
|
|
<li><a href="../db/SecondaryConfig.html#setAllowPopulate-boolean-"><code>AllowPopulate</code></a> is set to
|
|
true when a secondary key is added to an existing primary index.</li>
|
|
<li><a href="../db/SecondaryConfig.html#setKeyCreator-com.sleepycat.db.SecondaryKeyCreator-"><code>KeyCreator</code></a> or <a href="../db/SecondaryConfig.html#setMultiKeyCreator-com.sleepycat.db.SecondaryMultiKeyCreator-"><code>MultiKeyCreator</code></a> is set to an
|
|
internal instance.</li>
|
|
<li><a href="../db/SecondaryConfig.html#setForeignMultiKeyNullifier-com.sleepycat.db.ForeignMultiKeyNullifier-"><code>ForeignMultiKeyNullifier</code></a> is set to an internal instance if <a href="model/SecondaryKey.html#onRelatedEntityDelete--"><code>SecondaryKey.onRelatedEntityDelete()</code></a> is <a href="model/DeleteAction.html#NULLIFY"><code>DeleteAction.NULLIFY</code></a>.</li>
|
|
</ul></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>entityClass</code> - the entity class containing the given secondary key
|
|
name.</dd>
|
|
<dd><code>keyName</code> - the name of the secondary key field, or the <a href="model/SecondaryKey.html#name--"><code>SecondaryKey.name()</code></a> if this name annotation property was specified.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the default configuration for the given secondary key.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="setSecondaryConfig-java.lang.Class-java.lang.String-com.sleepycat.db.SecondaryConfig-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>setSecondaryConfig</h4>
|
|
<pre class="methodSignature">public void setSecondaryConfig​(java.lang.Class entityClass,
|
|
java.lang.String keyName,
|
|
<a href="../db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</a> config)</pre>
|
|
<div class="block">Configures a secondary database for an entity class and key name using
|
|
the Berkeley DB engine API.
|
|
|
|
<p>To be compatible with the entity model and the Direct Persistence
|
|
Layer, the configuration should be retrieved using <a href="#getSecondaryConfig-java.lang.Class-java.lang.String-"><code>getSecondaryConfig</code></a>, modified, and then passed to
|
|
this method. The following configuration properties may not be
|
|
changed:</p>
|
|
<ul>
|
|
<li><a href="../db/DatabaseConfig.html#setExclusiveCreate-boolean-"><code>ExclusiveCreate</code></a></li>
|
|
<li><a href="../db/DatabaseConfig.html#setSortedDuplicates-boolean-"><code>SortedDuplicates</code></a></li>
|
|
<li><a href="../db/DatabaseConfig.html#setBtreeComparator-java.util.Comparator-"><code>BtreeComparator</code></a></li>
|
|
<li><a href="../db/DatabaseConfig.html#setDuplicateComparator-java.util.Comparator-"><code>DuplicateComparator</code></a></li>
|
|
<li><a href="../db/SecondaryConfig.html#setAllowPopulate-boolean-"><code>AllowPopulate</code></a></li>
|
|
<li><a href="../db/SecondaryConfig.html#setKeyCreator-com.sleepycat.db.SecondaryKeyCreator-"><code>KeyCreator</code></a></li>
|
|
<li><a href="../db/SecondaryConfig.html#setMultiKeyCreator-com.sleepycat.db.SecondaryMultiKeyCreator-"><code>MultiKeyCreator</code></a></li>
|
|
<li><a href="../db/SecondaryConfig.html#setForeignKeyNullifier-com.sleepycat.db.ForeignKeyNullifier-"><code>ForeignKeyNullifier</code></a></li>
|
|
<li><a href="../db/SecondaryConfig.html#setForeignMultiKeyNullifier-com.sleepycat.db.ForeignMultiKeyNullifier-"><code>ForeignMultiKeyNullifier</code></a></li>
|
|
<li><a href="../db/SecondaryConfig.html#setForeignKeyDeleteAction-com.sleepycat.db.ForeignKeyDeleteAction-"><code>ForeignKeyDeleteAction</code></a></li>
|
|
<li><a href="../db/SecondaryConfig.html#setForeignKeyDatabase-com.sleepycat.db.Database-"><code>ForeignKeyDatabase</code></a></li>
|
|
</ul>
|
|
<p>In addition, <a href="../db/DatabaseConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> must be
|
|
the inverse of <code>ReadOnly</code></p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>entityClass</code> - the entity class containing the given secondary key
|
|
name.</dd>
|
|
<dd><code>keyName</code> - the name of the secondary key field, or the <a href="model/SecondaryKey.html#name--"><code>SecondaryKey.name()</code></a> if this name annotation property was specified.</dd>
|
|
<dd><code>config</code> - the configuration to use for the given secondary key.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.IllegalArgumentException</code> - if the configuration is incompatible
|
|
with the entity model or the Direct Persistence Layer.</dd>
|
|
<dd><code>java.lang.IllegalStateException</code> - if the database has already been opened.</dd>
|
|
</dl>
|
|
</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="../../../index.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/EntityStore.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 class="aboutLanguage"><b>Berkeley DB</b><br><font size="-1"> version 18.1.40</font></div>
|
|
</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>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip.navbar.bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
<p class="legalCopy"><small><font size=1>Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.</font></small></p>
|
|
</body>
|
|
</html>
|