je/docs/java/com/sleepycat/persist/EntityStore.html

1289 lines
79 KiB
HTML
Raw Permalink Normal View History

2021-06-06 17:46:45 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Tue Oct 31 17:36:46 EDT 2017 -->
<title>EntityStore (Oracle - Berkeley DB Java Edition API)</title>
<meta name="date" content="2017-10-31">
<link rel="stylesheet" type="text/css" href="../../../style.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="EntityStore (Oracle - Berkeley DB Java Edition API)";
}
}
catch(err) {
}
//-->
var methods = {"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":9,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="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 Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/sleepycat/persist/EntityResult.html" title="class in com.sleepycat.persist"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/sleepycat/persist/EntityStore.html" target="_top">Frames</a></li>
<li><a href="EntityStore.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.sleepycat.persist</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">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Closeable, java.lang.AutoCloseable</dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">EntityStore</span>
extends java.lang.Object
implements java.io.Closeable</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="../../../com/sleepycat/je/Environment.html" title="class in com.sleepycat.je"><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="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/model/Entity.html" title="annotation in com.sleepycat.persist.model"><code>Entity</code></a>, <a href="../../../com/sleepycat/persist/model/PrimaryKey.html" title="annotation in com.sleepycat.persist.model"><code>PrimaryKey</code></a> and <a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and
<a href="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><code>SecondaryIndex</code></a> objects by calling <a href="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex</code></a> and <a href="../../../com/sleepycat/persist/EntityStore.html#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="../../../com/sleepycat/je/package-summary.html"><code>Base API</code></a>. Methods in the <a href="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and <a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/je/DatabaseEntry.html" title="class in com.sleepycat.je"><code>DatabaseEntry</code></a> objects and entity model
objects.</p>
<p>Each primary and secondary index is associated internally with a <a href="../../../com/sleepycat/je/Database.html" title="class in com.sleepycat.je"><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="../../../com/sleepycat/persist/EntityStore.html#setPrimaryConfig-java.lang.Class-com.sleepycat.je.DatabaseConfig-"><code>setPrimaryConfig</code></a> and <a href="../../../com/sleepycat/persist/EntityStore.html#setSecondaryConfig-java.lang.Class-java.lang.String-com.sleepycat.je.SecondaryConfig-"><code>setSecondaryConfig</code></a> methods may be called anytime before a database is
opened via <a href="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex</code></a> or <a href="../../../com/sleepycat/persist/EntityStore.html#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex</code></a>. The <a href="../../../com/sleepycat/persist/EntityStore.html#setSequenceConfig-java.lang.String-com.sleepycat.je.SequenceConfig-"><code>setSequenceConfig</code></a> method may be called anytime before <a href="../../../com/sleepycat/persist/EntityStore.html#getSequence-java.lang.String-"><code>getSequence</code></a> is called or <a href="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex</code></a> is called
for a primary index associated with that sequence.</p>
<!-- begin JE only -->
<h3>Database Names</h3>
<p>The database names of primary and secondary indices are designed to be
unique within the environment and identifiable for debugging and use with
tools such as <a href="../../../com/sleepycat/je/util/DbDump.html" title="class in com.sleepycat.je.util"><code>DbDump</code></a> and <a href="../../../com/sleepycat/je/util/DbLoad.html" title="class in com.sleepycat.je.util"><code>DbLoad</code></a>.</p>
<p>The syntax of a primary index database name is:</p>
<pre> persist#STORE_NAME#ENTITY_CLASS</pre>
<p>Where STORE_NAME is the name parameter passed to <a href="../../../com/sleepycat/persist/EntityStore.html#EntityStore-com.sleepycat.je.Environment-java.lang.String-com.sleepycat.persist.StoreConfig-"><code>EntityStore</code></a> and ENTITY_CLASS is name of the class passed to <a href="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex</code></a>.</p>
<p>The syntax of a secondary index database name is:</p>
<pre> persist#STORE_NAME#ENTITY_CLASS#KEY_NAME</pre>
<p>Where KEY_NAME is the secondary key name passed to <a href="../../../com/sleepycat/persist/EntityStore.html#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex</code></a>.</p>
<p>Although you should never have to construct these names manually,
understanding their syntax is useful for several reasons:</p>
<ul>
<li>Exception messages sometimes contain the database name, from which you
can identify the entity class and secondary key.</li>
<li>If you create other databases in the same environment that are not
part of an <code>EntityStore</code>, to avoid naming conflicts the other
database names should not begin with <code>"persist#"</code>.</li>
<li>If you are using <a href="../../../com/sleepycat/je/util/DbDump.html" title="class in com.sleepycat.je.util"><code>DbDump</code></a> or <a href="../../../com/sleepycat/je/util/DbLoad.html" title="class in com.sleepycat.je.util"><code>DbLoad</code></a> to perform a backup or copy databases between
environments, knowing the database names can be useful. Normally you will
dump or load all database names starting with
<code>"persist#STORE_NAME#"</code>.</li>
</ul>
<p>If you are copying all databases in a store as mentioned in the last
point above, there is one further consideration. There are two internal
databases that must be kept with the other databases in the store in order
for the store to be used. These contain the data formats and sequences for
the store:</p>
<pre> persist#STORE_NAME#com.sleepycat.persist.formats</pre>
<pre> persist#STORE_NAME#com.sleepycat.persist.sequences</pre>
<p>These databases must normally be included with copies of other databases
in the store. They should not be modified by the application.</p>
<p>For example, the following code snippet removes all databases for a given
store in a single transaction.</p>
<pre class="code">
Environment env = ...
EntityStore store = ...
Transaction txn = env.beginTransaction(null, null);
String prefix = "persist#" + store.getStoreName() + "#";
for (String dbName : env.getDatabaseNames()) {
if (dbName.startsWith(prefix)) {
env.removeDatabase(txn, dbName);
}
}
txn.commit();</pre>
<!-- end JE only --></div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Mark Hayes</dd>
</dl>
</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" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#EntityStore-com.sleepycat.je.Environment-java.lang.String-com.sleepycat.persist.StoreConfig-">EntityStore</a></span>(<a href="../../../com/sleepycat/je/Environment.html" title="class in com.sleepycat.je">Environment</a>&nbsp;env,
java.lang.String&nbsp;storeName,
<a href="../../../com/sleepycat/persist/StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</a>&nbsp;config)</code>
<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" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#close--">close</a></span>()</code>
<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>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#closeClass-java.lang.Class-">closeClass</a></span>(java.lang.Class&nbsp;entityClass)</code>
<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="../../../com/sleepycat/persist/evolve/EvolveStats.html" title="class in com.sleepycat.persist.evolve">EvolveStats</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#evolve-com.sleepycat.persist.evolve.EvolveConfig-">evolve</a></span>(<a href="../../../com/sleepycat/persist/evolve/EvolveConfig.html" title="class in com.sleepycat.persist.evolve">EvolveConfig</a>&nbsp;config)</code>
<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="../../../com/sleepycat/persist/StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getConfig--">getConfig</a></span>()</code>
<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="../../../com/sleepycat/je/Environment.html" title="class in com.sleepycat.je">Environment</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getEnvironment--">getEnvironment</a></span>()</code>
<div class="block">Returns the environment associated with this store.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../com/sleepycat/persist/model/EntityModel.html" title="class in com.sleepycat.persist.model">EntityModel</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getModel--">getModel</a></span>()</code>
<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="../../../com/sleepycat/persist/evolve/Mutations.html" title="class in com.sleepycat.persist.evolve">Mutations</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getMutations--">getMutations</a></span>()</code>
<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="../../../com/sleepycat/je/DatabaseConfig.html" title="class in com.sleepycat.je">DatabaseConfig</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getPrimaryConfig-java.lang.Class-">getPrimaryConfig</a></span>(java.lang.Class&nbsp;entityClass)</code>
<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>&lt;PK,E&gt;&nbsp;<a href="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a>&lt;PK,E&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex-java.lang.Class-java.lang.Class-">getPrimaryIndex</a></span>(java.lang.Class&lt;PK&gt;&nbsp;primaryKeyClass,
java.lang.Class&lt;E&gt;&nbsp;entityClass)</code>
<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="../../../com/sleepycat/je/SecondaryConfig.html" title="class in com.sleepycat.je">SecondaryConfig</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getSecondaryConfig-java.lang.Class-java.lang.String-">getSecondaryConfig</a></span>(java.lang.Class&nbsp;entityClass,
java.lang.String&nbsp;keyName)</code>
<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>&lt;SK,PK,E&gt;&nbsp;<a href="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</a>&lt;SK,PK,E&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-">getSecondaryIndex</a></span>(<a href="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a>&lt;PK,E&gt;&nbsp;primaryIndex,
java.lang.Class&lt;SK&gt;&nbsp;keyClass,
java.lang.String&nbsp;keyName)</code>
<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="../../../com/sleepycat/je/Sequence.html" title="class in com.sleepycat.je">Sequence</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getSequence-java.lang.String-">getSequence</a></span>(java.lang.String&nbsp;name)</code>
<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="../../../com/sleepycat/je/SequenceConfig.html" title="class in com.sleepycat.je">SequenceConfig</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getSequenceConfig-java.lang.String-">getSequenceConfig</a></span>(java.lang.String&nbsp;name)</code>
<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>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getStoreName--">getStoreName</a></span>()</code>
<div class="block">Returns the name of this store.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static java.util.Set&lt;java.lang.String&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getStoreNames-com.sleepycat.je.Environment-">getStoreNames</a></span>(<a href="../../../com/sleepycat/je/Environment.html" title="class in com.sleepycat.je">Environment</a>&nbsp;env)</code>
<div class="block">Returns the names of all entity stores in the given environment.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>&lt;SK,PK,E1,E2 extends E1&gt;<br><a href="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</a>&lt;SK,PK,E2&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#getSubclassIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.Class-java.lang.String-">getSubclassIndex</a></span>(<a href="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a>&lt;PK,E1&gt;&nbsp;primaryIndex,
java.lang.Class&lt;E2&gt;&nbsp;entitySubclass,
java.lang.Class&lt;SK&gt;&nbsp;keyClass,
java.lang.String&nbsp;keyName)</code>
<div class="block">Returns a secondary index for a secondary key in an entity subclass,
opening it if necessary.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#setPrimaryConfig-java.lang.Class-com.sleepycat.je.DatabaseConfig-">setPrimaryConfig</a></span>(java.lang.Class&nbsp;entityClass,
<a href="../../../com/sleepycat/je/DatabaseConfig.html" title="class in com.sleepycat.je">DatabaseConfig</a>&nbsp;config)</code>
<div class="block">Configures the primary database for an entity class using the Berkeley
DB engine API.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#setSecondaryConfig-java.lang.Class-java.lang.String-com.sleepycat.je.SecondaryConfig-">setSecondaryConfig</a></span>(java.lang.Class&nbsp;entityClass,
java.lang.String&nbsp;keyName,
<a href="../../../com/sleepycat/je/SecondaryConfig.html" title="class in com.sleepycat.je">SecondaryConfig</a>&nbsp;config)</code>
<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="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#setSequenceConfig-java.lang.String-com.sleepycat.je.SequenceConfig-">setSequenceConfig</a></span>(java.lang.String&nbsp;name,
<a href="../../../com/sleepycat/je/SequenceConfig.html" title="class in com.sleepycat.je">SequenceConfig</a>&nbsp;config)</code>
<div class="block">Configures a named key sequence using the Berkeley DB engine API.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#sync--">sync</a></span>()</code>
<div class="block">Flushes each modified index to disk that was opened in deferred-write
mode.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#truncateClass-java.lang.Class-">truncateClass</a></span>(java.lang.Class&nbsp;entityClass)</code>
<div class="block">Deletes all instances of this entity class and its (non-entity)
subclasses.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/persist/EntityStore.html#truncateClass-com.sleepycat.je.Transaction-java.lang.Class-">truncateClass</a></span>(<a href="../../../com/sleepycat/je/Transaction.html" title="class in com.sleepycat.je">Transaction</a>&nbsp;txn,
java.lang.Class&nbsp;entityClass)</code>
<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&nbsp;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.je.Environment-java.lang.String-com.sleepycat.persist.StoreConfig-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>EntityStore</h4>
<pre>public&nbsp;EntityStore(<a href="../../../com/sleepycat/je/Environment.html" title="class in com.sleepycat.je">Environment</a>&nbsp;env,
java.lang.String&nbsp;storeName,
<a href="../../../com/sleepycat/persist/StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</a>&nbsp;config)
throws <a href="../../../com/sleepycat/persist/StoreExistsException.html" title="class in com.sleepycat.persist">StoreExistsException</a>,
<a href="../../../com/sleepycat/persist/StoreNotFoundException.html" title="class in com.sleepycat.persist">StoreNotFoundException</a>,
<a href="../../../com/sleepycat/persist/evolve/IncompatibleClassException.html" title="class in com.sleepycat.persist.evolve">IncompatibleClassException</a>,
<a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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="../../../com/sleepycat/persist/StoreExistsException.html" title="class in com.sleepycat.persist">StoreExistsException</a></code> - when the <a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/StoreNotFoundException.html" title="class in com.sleepycat.persist">StoreNotFoundException</a></code> - when when the <a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/evolve/package-summary.html"><code>Class Evolution</code></a> for more
information.
<!-- begin JE only --></dd>
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if one of the <a
href="../je/OperationFailureException.html#readFailures">Read Operation
Failures</a> occurs. If the store does not exist and the <a href="../../../com/sleepycat/persist/StoreConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> parameter is true, then one of
the <a href="../je/OperationFailureException.html#writeFailures">Write
Operation Failures</a> may also occur.</dd>
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
environment-wide failure occurs.
<!-- end JE only --></dd>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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>public&nbsp;<a href="../../../com/sleepycat/je/Environment.html" title="class in com.sleepycat.je">Environment</a>&nbsp;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>public&nbsp;<a href="../../../com/sleepycat/persist/StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</a>&nbsp;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>public&nbsp;java.lang.String&nbsp;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="getStoreNames-com.sleepycat.je.Environment-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStoreNames</h4>
<pre>public static&nbsp;java.util.Set&lt;java.lang.String&gt;&nbsp;getStoreNames(<a href="../../../com/sleepycat/je/Environment.html" title="class in com.sleepycat.je">Environment</a>&nbsp;env)
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
<div class="block">Returns the names of all entity stores in the given environment.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the store names. An empty set is returned if no stores are
present.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if one of the <a
href="../je/OperationFailureException.html#readFailures">Read Operation
Failures</a> occurs.</dd>
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
environment-wide failure occurs.</dd>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
</dl>
</li>
</ul>
<a name="getModel--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getModel</h4>
<pre>public&nbsp;<a href="../../../com/sleepycat/persist/model/EntityModel.html" title="class in com.sleepycat.persist.model">EntityModel</a>&nbsp;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>public&nbsp;<a href="../../../com/sleepycat/persist/evolve/Mutations.html" title="class in com.sleepycat.persist.evolve">Mutations</a>&nbsp;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>public&nbsp;&lt;PK,E&gt;&nbsp;<a href="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a>&lt;PK,E&gt;&nbsp;getPrimaryIndex(java.lang.Class&lt;PK&gt;&nbsp;primaryKeyClass,
java.lang.Class&lt;E&gt;&nbsp;entityClass)
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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.
<!-- begin JE only --></dd>
<dd><code><a href="../../../com/sleepycat/persist/IndexNotAvailableException.html" title="class in com.sleepycat.persist">IndexNotAvailableException</a></code> - in a replicated environment if this
Replica's persistent classes have been upgraded to define a new index,
but the Master has not yet been upgraded.</dd>
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if one of the <a
href="../je/OperationFailureException.html#readFailures">Read Operation
Failures</a> occurs. If the index does not exist and the <a href="../../../com/sleepycat/persist/StoreConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a> parameter is false, then one of the <a
href="../je/OperationFailureException.html#writeFailures">Write
Operation Failures</a> may also occur.</dd>
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
environment-wide failure occurs.
<!-- end JE only --></dd>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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>public&nbsp;&lt;SK,PK,E&gt;&nbsp;<a href="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</a>&lt;SK,PK,E&gt;&nbsp;getSecondaryIndex(<a href="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a>&lt;PK,E&gt;&nbsp;primaryIndex,
java.lang.Class&lt;SK&gt;&nbsp;keyClass,
java.lang.String&nbsp;keyName)
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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="../../../com/sleepycat/persist/EntityStore.html#getSubclassIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.Class-java.lang.String-"><code>getSubclassIndex(com.sleepycat.persist.PrimaryIndex&lt;PK, E1&gt;, java.lang.Class&lt;E2&gt;, java.lang.Class&lt;SK&gt;, java.lang.String)</code></a> instead.</p>
<p>If a <a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/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.
<!-- begin JE only --></dd>
<dd><code><a href="../../../com/sleepycat/persist/IndexNotAvailableException.html" title="class in com.sleepycat.persist">IndexNotAvailableException</a></code> - in a replicated environment if this
Replica's persistent classes have been upgraded to define a new index,
but the Master has not yet been upgraded.</dd>
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if one of the <a
href="../je/OperationFailureException.html#readFailures">Read Operation
Failures</a> occurs. If the index does not exist and the <a href="../../../com/sleepycat/persist/StoreConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a> parameter is false, then one of the <a
href="../je/OperationFailureException.html#writeFailures">Write
Operation Failures</a> may also occur.</dd>
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
environment-wide failure occurs.
<!-- end JE only --></dd>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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>public&nbsp;&lt;SK,PK,E1,E2 extends E1&gt;&nbsp;<a href="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</a>&lt;SK,PK,E2&gt;&nbsp;getSubclassIndex(<a href="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</a>&lt;PK,E1&gt;&nbsp;primaryIndex,
java.lang.Class&lt;E2&gt;&nbsp;entitySubclass,
java.lang.Class&lt;SK&gt;&nbsp;keyClass,
java.lang.String&nbsp;keyName)
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/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.
<!-- begin JE only --></dd>
<dd><code><a href="../../../com/sleepycat/persist/IndexNotAvailableException.html" title="class in com.sleepycat.persist">IndexNotAvailableException</a></code> - in a replicated environment if this
Replica's persistent classes have been upgraded to define a new index,
but the Master has not yet been upgraded.</dd>
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if one of the <a
href="../je/OperationFailureException.html#readFailures">Read Operation
Failures</a> occurs. If the index does not exist and the <a href="../../../com/sleepycat/persist/StoreConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a> parameter is false, then one of the <a
href="../je/OperationFailureException.html#writeFailures">Write
Operation Failures</a> may also occur.</dd>
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
environment-wide failure occurs.
<!-- end JE only --></dd>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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>public&nbsp;<a href="../../../com/sleepycat/persist/evolve/EvolveStats.html" title="class in com.sleepycat.persist.evolve">EvolveStats</a>&nbsp;evolve(<a href="../../../com/sleepycat/persist/evolve/EvolveConfig.html" title="class in com.sleepycat.persist.evolve">EvolveConfig</a>&nbsp;config)
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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="../../../com/sleepycat/persist/evolve/Mutations.html" title="class in com.sleepycat.persist.evolve"><code>Mutations</code></a> associated with it via
<a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/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.
<!-- begin JE only --></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if one of the <a
href="../je/OperationFailureException.html#writeFailures">Write
Operation Failures</a> occurs.</dd>
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
environment-wide failure occurs.
<!-- end JE only --></dd>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../com/sleepycat/persist/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>public&nbsp;void&nbsp;truncateClass(java.lang.Class&nbsp;entityClass)
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and
<a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex(java.lang.Class&lt;PK&gt;, java.lang.Class&lt;E&gt;)</code></a> and <a href="../../../com/sleepycat/persist/EntityStore.html#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex(com.sleepycat.persist.PrimaryIndex&lt;PK, E&gt;, java.lang.Class&lt;SK&gt;, 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.
<!-- begin JE only --></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if one of the <a
href="../je/OperationFailureException.html#writeFailures">Write
Operation Failures</a> occurs.</dd>
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
environment-wide failure occurs.
<!-- end JE only --></dd>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
</dl>
</li>
</ul>
<a name="truncateClass-com.sleepycat.je.Transaction-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>truncateClass</h4>
<pre>public&nbsp;void&nbsp;truncateClass(<a href="../../../com/sleepycat/je/Transaction.html" title="class in com.sleepycat.je">Transaction</a>&nbsp;txn,
java.lang.Class&nbsp;entityClass)
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and
<a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex(java.lang.Class&lt;PK&gt;, java.lang.Class&lt;E&gt;)</code></a> and <a href="../../../com/sleepycat/persist/EntityStore.html#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex(com.sleepycat.persist.PrimaryIndex&lt;PK, E&gt;, java.lang.Class&lt;SK&gt;, 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.
<!-- begin JE only --></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../com/sleepycat/je/OperationFailureException.html" title="class in com.sleepycat.je">OperationFailureException</a></code> - if one of the <a
href="../je/OperationFailureException.html#writeFailures">Write
Operation Failures</a> occurs.</dd>
<dd><code><a href="../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
environment-wide failure occurs.
<!-- end JE only --></dd>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code> - the base class for all BDB exceptions.</dd>
</dl>
</li>
</ul>
<a name="sync--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sync</h4>
<pre>public&nbsp;void&nbsp;sync()
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
<div class="block">Flushes each modified index to disk that was opened in deferred-write
mode.
<p>All indexes are opened in deferred-write mode if true was passed to
<a href="../../../com/sleepycat/persist/StoreConfig.html#setDeferredWrite-boolean-"><code>StoreConfig.setDeferredWrite(boolean)</code></a> for the store.</p>
<p>Alternatively, individual databases may be configured for deferred
write using <a href="../../../com/sleepycat/je/DatabaseConfig.html#setDeferredWrite-boolean-"><code>DatabaseConfig.setDeferredWrite(boolean)</code></a> along with <a href="../../../com/sleepycat/persist/EntityStore.html#getPrimaryConfig-java.lang.Class-"><code>getPrimaryConfig(java.lang.Class)</code></a> and <a href="../../../com/sleepycat/persist/EntityStore.html#setPrimaryConfig-java.lang.Class-com.sleepycat.je.DatabaseConfig-"><code>setPrimaryConfig(java.lang.Class, com.sleepycat.je.DatabaseConfig)</code></a>. Caution should be
used when configuring only some databases for deferred-write, since
durability will be different for these databases than for other
databases in the same store.</p>
<p>This method is equivalent to calling <a href="../../../com/sleepycat/je/Database.html#sync--"><code>Database.sync()</code></a> for each
deferred-write index Database that is open for this store.
<p>Instead of calling this method, <a href="../../../com/sleepycat/je/Environment.html#sync--"><code>Environment.sync()</code></a> may be used.
The difference is that this method will only flush the databases for
this store, while <a href="../../../com/sleepycat/je/Environment.html#sync--"><code>Environment.sync()</code></a> will sync all deferred-write
databases currently open for the environment and will also perform a
full checkpoint. This method is therefore less expensive than a full
sync of the environment.</p></div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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>public&nbsp;void&nbsp;closeClass(java.lang.Class&nbsp;entityClass)
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><code>PrimaryIndex</code></a> and
<a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex-java.lang.Class-java.lang.Class-"><code>getPrimaryIndex(java.lang.Class&lt;PK&gt;, java.lang.Class&lt;E&gt;)</code></a> and <a href="../../../com/sleepycat/persist/EntityStore.html#getSecondaryIndex-com.sleepycat.persist.PrimaryIndex-java.lang.Class-java.lang.String-"><code>getSecondaryIndex(com.sleepycat.persist.PrimaryIndex&lt;PK, E&gt;, java.lang.Class&lt;SK&gt;, 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="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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>public&nbsp;void&nbsp;close()
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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.
<!-- begin JE only -->
<p>WARNING: To prevent memory leaks, the application must call this
method even when the Environment has become invalid. While this is not
necessary for Database objects, it is necessary for EntityStore objects
to prevent the accumulation of memory in the global DPL metadata cache.
<!-- end JE only -->
<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="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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>public&nbsp;<a href="../../../com/sleepycat/je/Sequence.html" title="class in com.sleepycat.je">Sequence</a>&nbsp;getSequence(java.lang.String&nbsp;name)
throws <a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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="../../../com/sleepycat/persist/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="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">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>public&nbsp;<a href="../../../com/sleepycat/je/SequenceConfig.html" title="class in com.sleepycat.je">SequenceConfig</a>&nbsp;getSequenceConfig(java.lang.String&nbsp;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="../../../com/sleepycat/je/SequenceConfig.html#setInitialValue-long-"><code>InitialValue</code></a> is one.</li>
<li>The <a href="../../../com/sleepycat/je/SequenceConfig.html#setRange-long-long-"><code>Range</code></a> minimum is one.</li>
<li>The <a href="../../../com/sleepycat/je/SequenceConfig.html#setCacheSize-int-"><code>CacheSize</code></a> is 100.</li>
<li><a href="../../../com/sleepycat/je/SequenceConfig.html#setAutoCommitNoSync-boolean-"><code>AutoCommitNoSync</code></a> is
true.</li>
<li><a href="../../../com/sleepycat/je/SequenceConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> is set to the
inverse of the store <a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/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.je.SequenceConfig-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSequenceConfig</h4>
<pre>public&nbsp;void&nbsp;setSequenceConfig(java.lang.String&nbsp;name,
<a href="../../../com/sleepycat/je/SequenceConfig.html" title="class in com.sleepycat.je">SequenceConfig</a>&nbsp;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="../../../com/sleepycat/persist/EntityStore.html#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="../../../com/sleepycat/je/SequenceConfig.html#setExclusiveCreate-boolean-"><code>ExclusiveCreate</code></a></li>
</ul>
<p>In addition, <a href="../../../com/sleepycat/je/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="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/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>public&nbsp;<a href="../../../com/sleepycat/je/DatabaseConfig.html" title="class in com.sleepycat.je">DatabaseConfig</a>&nbsp;getPrimaryConfig(java.lang.Class&nbsp;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="../../../com/sleepycat/je/DatabaseConfig.html#setTransactional-boolean-"><code>Transactional</code></a> is set to
match <a href="../../../com/sleepycat/persist/StoreConfig.html#setTransactional-boolean-"><code>StoreConfig</code></a>.</li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> is set to the
inverse of the store <a href="../../../com/sleepycat/persist/StoreConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a>.
setting.</li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a> is set to match
<a href="../../../com/sleepycat/persist/StoreConfig.html#setReadOnly-boolean-"><code>StoreConfig</code></a>.</li>
<!-- begin JE only --> *
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setDeferredWrite-boolean-"><code>DeferredWrite</code></a> is set to
match <a href="../../../com/sleepycat/persist/StoreConfig.html#setDeferredWrite-boolean-"><code>StoreConfig</code></a>.</li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setTemporary-boolean-"><code>Temporary</code></a> is set to
match <a href="../../../com/sleepycat/persist/StoreConfig.html#setTemporary-boolean-"><code>StoreConfig</code></a>.</li>
<!-- end JE only --> *
<li><a href="../../../com/sleepycat/je/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.je.DatabaseConfig-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPrimaryConfig</h4>
<pre>public&nbsp;void&nbsp;setPrimaryConfig(java.lang.Class&nbsp;entityClass,
<a href="../../../com/sleepycat/je/DatabaseConfig.html" title="class in com.sleepycat.je">DatabaseConfig</a>&nbsp;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="../../../com/sleepycat/persist/EntityStore.html#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="../../../com/sleepycat/je/DatabaseConfig.html#setExclusiveCreate-boolean-"><code>ExclusiveCreate</code></a></li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setSortedDuplicates-boolean-"><code>SortedDuplicates</code></a></li>
<!-- begin JE only --> *
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setTemporary-boolean-"><code>Temporary</code></a></li>
<!-- end JE only --> *
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setBtreeComparator-java.util.Comparator-"><code>BtreeComparator</code></a></li>
</ul>
<p>In addition, <a href="../../../com/sleepycat/je/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>public&nbsp;<a href="../../../com/sleepycat/je/SecondaryConfig.html" title="class in com.sleepycat.je">SecondaryConfig</a>&nbsp;getSecondaryConfig(java.lang.Class&nbsp;entityClass,
java.lang.String&nbsp;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="../../../com/sleepycat/je/DatabaseConfig.html#setTransactional-boolean-"><code>Transactional</code></a> is set to
match the primary database.</li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setAllowCreate-boolean-"><code>AllowCreate</code></a> is set to the
inverse of the primary database <a href="../../../com/sleepycat/je/DatabaseConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a> setting.</li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setReadOnly-boolean-"><code>ReadOnly</code></a> is set to match
the primary database.</li>
<!-- begin JE only --> *
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setDeferredWrite-boolean-"><code>DeferredWrite</code></a> is set to
match the primary database.</li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setTemporary-boolean-"><code>Temporary</code></a> is set to
match <a href="../../../com/sleepycat/persist/StoreConfig.html#setTemporary-boolean-"><code>StoreConfig</code></a>.</li>
<!-- end JE only --> *
<li><a href="../../../com/sleepycat/je/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="../../../com/sleepycat/je/DatabaseConfig.html#setSortedDuplicates-boolean-"><code>SortedDuplicates</code></a> is set
according to <a href="../../../com/sleepycat/persist/model/SecondaryKey.html#relate--"><code>SecondaryKey.relate()</code></a>.</li>
<li><a href="../../../com/sleepycat/je/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="../../../com/sleepycat/je/SecondaryConfig.html#setKeyCreator-com.sleepycat.je.SecondaryKeyCreator-"><code>KeyCreator</code></a> or <a href="../../../com/sleepycat/je/SecondaryConfig.html#setMultiKeyCreator-com.sleepycat.je.SecondaryMultiKeyCreator-"><code>MultiKeyCreator</code></a> is set to an
internal instance.</li>
<li><a href="../../../com/sleepycat/je/SecondaryConfig.html#setForeignMultiKeyNullifier-com.sleepycat.je.ForeignMultiKeyNullifier-"><code>ForeignMultiKeyNullifier</code></a> is set to an internal instance if <a href="../../../com/sleepycat/persist/model/SecondaryKey.html#onRelatedEntityDelete--"><code>SecondaryKey.onRelatedEntityDelete()</code></a> is <a href="../../../com/sleepycat/persist/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="../../../com/sleepycat/persist/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.je.SecondaryConfig-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setSecondaryConfig</h4>
<pre>public&nbsp;void&nbsp;setSecondaryConfig(java.lang.Class&nbsp;entityClass,
java.lang.String&nbsp;keyName,
<a href="../../../com/sleepycat/je/SecondaryConfig.html" title="class in com.sleepycat.je">SecondaryConfig</a>&nbsp;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="../../../com/sleepycat/persist/EntityStore.html#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="../../../com/sleepycat/je/DatabaseConfig.html#setExclusiveCreate-boolean-"><code>ExclusiveCreate</code></a></li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setSortedDuplicates-boolean-"><code>SortedDuplicates</code></a></li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setBtreeComparator-java.util.Comparator-"><code>BtreeComparator</code></a></li>
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setDuplicateComparator-java.util.Comparator-"><code>DuplicateComparator</code></a></li>
<!-- begin JE only --> *
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html#setTemporary-boolean-"><code>Temporary</code></a></li>
<!-- end JE only --> *
<li><a href="../../../com/sleepycat/je/SecondaryConfig.html#setAllowPopulate-boolean-"><code>AllowPopulate</code></a></li>
<li><a href="../../../com/sleepycat/je/SecondaryConfig.html#setKeyCreator-com.sleepycat.je.SecondaryKeyCreator-"><code>KeyCreator</code></a></li>
<li><a href="../../../com/sleepycat/je/SecondaryConfig.html#setMultiKeyCreator-com.sleepycat.je.SecondaryMultiKeyCreator-"><code>MultiKeyCreator</code></a></li>
<li><a href="../../../com/sleepycat/je/SecondaryConfig.html#setForeignKeyNullifier-com.sleepycat.je.ForeignKeyNullifier-"><code>ForeignKeyNullifier</code></a></li>
<li><a href="../../../com/sleepycat/je/SecondaryConfig.html#setForeignMultiKeyNullifier-com.sleepycat.je.ForeignMultiKeyNullifier-"><code>ForeignMultiKeyNullifier</code></a></li>
<li><a href="../../../com/sleepycat/je/SecondaryConfig.html#setForeignKeyDeleteAction-com.sleepycat.je.ForeignKeyDeleteAction-"><code>ForeignKeyDeleteAction</code></a></li>
<li><a href="../../../com/sleepycat/je/SecondaryConfig.html#setForeignKeyDatabase-com.sleepycat.je.Database-"><code>ForeignKeyDatabase</code></a></li>
</ul>
<p>In addition, <a href="../../../com/sleepycat/je/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="../../../com/sleepycat/persist/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="../../../overview-summary.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 Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/sleepycat/persist/EntityResult.html" title="class in com.sleepycat.persist"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/sleepycat/persist/EntityStore.html" target="_top">Frames</a></li>
<li><a href="EntityStore.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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) 2002, 2017 Oracle and/or its affiliates. All rights reserved.</font> </small></p>
</body>
</html>