Debian Codegraph @

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

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.6.0_51) on Mon Sep 09 11:47:06 EDT 2013 -->
6 <TITLE>
7 EntityStore (Oracle - Berkeley DB Java API)
8 </TITLE>
9
10 <META NAME="date" CONTENT="2013-09-09">
11
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style">
13
14 <SCRIPT type="text/javascript">
15 function windowTitle()
16 {
17 if (location.href.indexOf('is-external=true') == -1) {
18 parent.document.title="EntityStore (Oracle - Berkeley DB Java API)";
19 }
20 }
21 </SCRIPT>
22 <NOSCRIPT>
23 </NOSCRIPT>
24
25 </HEAD>
26
27 <BODY BGCOLOR="white" onload="windowTitle();">
28 <HR>
29
30
31 <!-- ========= START OF TOP NAVBAR ======= -->
32 <A NAME="navbar_top"><!-- --></A>
33 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35 <TR>
36 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37 <A NAME="navbar_top_firstrow"><!-- --></A>
38 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39 <TR ALIGN="center" VALIGN="top">
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EntityStore.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48 </TR>
49 </TABLE>
50 </TD>
51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52 <b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM>
53 </TD>
54 </TR>
55
56 <TR>
57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58 &nbsp;<A HREF="../../../com/sleepycat/persist/EntityJoin.html" title="class in com.sleepycat.persist"><B>PREV CLASS</B></A>&nbsp;
59 &nbsp;<A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist"><B>NEXT CLASS</B></A></FONT></TD>
60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61 <A HREF="../../../index.html?com/sleepycat/persist/EntityStore.html" target="_top"><B>FRAMES</B></A> &nbsp;
62 &nbsp;<A HREF="EntityStore.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
63 &nbsp;<SCRIPT type="text/javascript">
64 <!--
65 if(window==top) {
66 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
67 }
68 //-->
69 </SCRIPT>
70 <NOSCRIPT>
71 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
72 </NOSCRIPT>
73
74
75 </FONT></TD>
76 </TR>
77 <TR>
78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
82 </TR>
83 </TABLE>
84 <A NAME="skip-navbar_top"></A>
85 <!-- ========= END OF TOP NAVBAR ========= -->
86
87 <HR>
88 <!-- ======== START OF CLASS DATA ======== -->
89 <H2>
90 <FONT SIZE="-1">
91 com.sleepycat.persist</FONT>
92 <BR>
93 Class EntityStore</H2>
94 <PRE>
95 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96 <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.persist.EntityStore</B>
97 </PRE>
98 <HR>
99 <DL>
100 <DT><PRE>public class <B>EntityStore</B><DT>extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
101 </PRE>
102
103 <P>
104 A store for managing persistent entity objects.
105
106 <p><code>EntityStore</code> objects are thread-safe. Multiple threads may safely
107 call the methods of a shared <code>EntityStore</code> object.</p>
108
109 <p>See the <a href="package-summary.html#example">package
110 summary example</a> for an example of using an <code>EntityStore</code>.</p>
111
112 <p>Before creating an <code>EntityStore</code> you must create an <A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db"><CODE>Environment</CODE></A> object using the Berkeley DB engine API. The environment may
113 contain any number of entity stores and their associated databases, as well
114 as other databases not associated with an entity store.</p>
115
116 <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
117 defines persistent classes (<em>entity classes</em>), primary keys,
118 secondary keys, and relationships between entities. A primary index is
119 created for each entity class. An associated secondary index is created for
120 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>
121
122 <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
123 <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
124 these indices to store and access entity records by key.</p>
125
126 <p>Although not normally needed, you can also use the entity store along
127 with the <A HREF="../../../com/sleepycat/db/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
128 databases and bindings. The databases may be used directly for accessing
129 entity records. The bindings should be called explicitly to translate
130 between <A HREF="../../../com/sleepycat/db/DatabaseEntry.html" title="class in com.sleepycat.db"><CODE>DatabaseEntry</CODE></A> objects and entity model
131 objects.</p>
132
133 <p>Each primary and secondary index is associated internally with a <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A>. With any of the above mentioned use cases, methods are provided
134 that may be used for database performance tuning. The <A HREF="../../../com/sleepycat/persist/EntityStore.html#setPrimaryConfig(java.lang.Class, com.sleepycat.db.DatabaseConfig)"><CODE>setPrimaryConfig</CODE></A> and <A HREF="../../../com/sleepycat/persist/EntityStore.html#setSecondaryConfig(java.lang.Class, java.lang.String, com.sleepycat.db.SecondaryConfig)"><CODE>setSecondaryConfig</CODE></A> methods may be called anytime before a database is
135 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.db.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
136 for a primary index associated with that sequence.</p>
137 <P>
138
139 <P>
140 <HR>
141
142 <P>
143
144 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
145
146 <A NAME="constructor_summary"><!-- --></A>
147 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
148 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
149 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
150 <B>Constructor Summary</B></FONT></TH>
151 </TR>
152 <TR BGCOLOR="white" CLASS="TableRowColor">
153 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#EntityStore(com.sleepycat.db.Environment, java.lang.String, com.sleepycat.persist.StoreConfig)">EntityStore</A></B>(<A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db">Environment</A>&nbsp;env,
154 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;storeName,
155 <A HREF="../../../com/sleepycat/persist/StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</A>&nbsp;config)</CODE>
156
157 <BR>
158 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Opens an entity store in a given environment.</TD>
159 </TR>
160 </TABLE>
161 &nbsp;
162 <!-- ========== METHOD SUMMARY =========== -->
163
164 <A NAME="method_summary"><!-- --></A>
165 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
166 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
167 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
168 <B>Method Summary</B></FONT></TH>
169 </TR>
170 <TR BGCOLOR="white" CLASS="TableRowColor">
171 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
172 <CODE>&nbsp;void</CODE></FONT></TD>
173 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#close()">close</A></B>()</CODE>
174
175 <BR>
176 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes all databases and sequences that were opened via this store.</TD>
177 </TR>
178 <TR BGCOLOR="white" CLASS="TableRowColor">
179 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
180 <CODE>&nbsp;void</CODE></FONT></TD>
181 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#closeClass(java.lang.Class)">closeClass</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass)</CODE>
182
183 <BR>
184 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes the primary and secondary databases for the given entity class
185 that were opened via this store.</TD>
186 </TR>
187 <TR BGCOLOR="white" CLASS="TableRowColor">
188 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
189 <CODE>&nbsp;<A HREF="../../../com/sleepycat/persist/evolve/EvolveStats.html" title="class in com.sleepycat.persist.evolve">EvolveStats</A></CODE></FONT></TD>
190 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#evolve(com.sleepycat.persist.evolve.EvolveConfig)">evolve</A></B>(<A HREF="../../../com/sleepycat/persist/evolve/EvolveConfig.html" title="class in com.sleepycat.persist.evolve">EvolveConfig</A>&nbsp;config)</CODE>
191
192 <BR>
193 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Performs conversion of unevolved objects in order to reduce lazy
194 conversion overhead.</TD>
195 </TR>
196 <TR BGCOLOR="white" CLASS="TableRowColor">
197 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
198 <CODE>&nbsp;<A HREF="../../../com/sleepycat/persist/StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</A></CODE></FONT></TD>
199 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getConfig()">getConfig</A></B>()</CODE>
200
201 <BR>
202 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a copy of the entity store configuration.</TD>
203 </TR>
204 <TR BGCOLOR="white" CLASS="TableRowColor">
205 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
206 <CODE>&nbsp;<A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db">Environment</A></CODE></FONT></TD>
207 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getEnvironment()">getEnvironment</A></B>()</CODE>
208
209 <BR>
210 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the environment associated with this store.</TD>
211 </TR>
212 <TR BGCOLOR="white" CLASS="TableRowColor">
213 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
214 <CODE>&nbsp;<A HREF="../../../com/sleepycat/persist/model/EntityModel.html" title="class in com.sleepycat.persist.model">EntityModel</A></CODE></FONT></TD>
215 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getModel()">getModel</A></B>()</CODE>
216
217 <BR>
218 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current entity model for this store.</TD>
219 </TR>
220 <TR BGCOLOR="white" CLASS="TableRowColor">
221 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
222 <CODE>&nbsp;<A HREF="../../../com/sleepycat/persist/evolve/Mutations.html" title="class in com.sleepycat.persist.evolve">Mutations</A></CODE></FONT></TD>
223 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getMutations()">getMutations</A></B>()</CODE>
224
225 <BR>
226 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the set of mutations that were configured when the store was
227 opened, or if none were configured, the set of mutations that were
228 configured and stored previously.</TD>
229 </TR>
230 <TR BGCOLOR="white" CLASS="TableRowColor">
231 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
232 <CODE>&nbsp;<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A></CODE></FONT></TD>
233 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getPrimaryConfig(java.lang.Class)">getPrimaryConfig</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass)</CODE>
234
235 <BR>
236 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the default primary database Berkeley DB engine API
237 configuration for an entity class.</TD>
238 </TR>
239 <TR BGCOLOR="white" CLASS="TableRowColor">
240 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
241 <CODE>
242 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
243 <TR ALIGN="right" VALIGN="">
244 <TD NOWRAP><FONT SIZE="-1">
245 <CODE>&lt;PK,E&gt; <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</A>&lt;PK,E&gt;</CODE></FONT></TD>
246 </TR>
247 </TABLE>
248 </CODE></FONT></TD>
249 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex(java.lang.Class, java.lang.Class)">getPrimaryIndex</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;PK&gt;&nbsp;primaryKeyClass,
250 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;E&gt;&nbsp;entityClass)</CODE>
251
252 <BR>
253 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the primary index for a given entity class, opening it if
254 necessary.</TD>
255 </TR>
256 <TR BGCOLOR="white" CLASS="TableRowColor">
257 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
258 <CODE>&nbsp;<A HREF="../../../com/sleepycat/db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</A></CODE></FONT></TD>
259 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getSecondaryConfig(java.lang.Class, java.lang.String)">getSecondaryConfig</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass,
260 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;keyName)</CODE>
261
262 <BR>
263 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the default secondary database Berkeley DB engine API
264 configuration for an entity class and key name.</TD>
265 </TR>
266 <TR BGCOLOR="white" CLASS="TableRowColor">
267 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
268 <CODE>
269 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
270 <TR ALIGN="right" VALIGN="">
271 <TD NOWRAP><FONT SIZE="-1">
272 <CODE>&lt;SK,PK,E&gt; <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</A>&lt;SK,PK,E&gt;</CODE></FONT></TD>
273 </TR>
274 </TABLE>
275 </CODE></FONT></TD>
276 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getSecondaryIndex(com.sleepycat.persist.PrimaryIndex, java.lang.Class, java.lang.String)">getSecondaryIndex</A></B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</A>&lt;PK,E&gt;&nbsp;primaryIndex,
277 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;SK&gt;&nbsp;keyClass,
278 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;keyName)</CODE>
279
280 <BR>
281 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a secondary index for a given primary index and secondary key,
282 opening it if necessary.</TD>
283 </TR>
284 <TR BGCOLOR="white" CLASS="TableRowColor">
285 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
286 <CODE>&nbsp;<A HREF="../../../com/sleepycat/db/Sequence.html" title="class in com.sleepycat.db">Sequence</A></CODE></FONT></TD>
287 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getSequence(java.lang.String)">getSequence</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</CODE>
288
289 <BR>
290 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a named sequence for using Berkeley DB engine API directly,
291 opening it if necessary.</TD>
292 </TR>
293 <TR BGCOLOR="white" CLASS="TableRowColor">
294 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
295 <CODE>&nbsp;<A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</A></CODE></FONT></TD>
296 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getSequenceConfig(java.lang.String)">getSequenceConfig</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</CODE>
297
298 <BR>
299 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the default Berkeley DB engine API configuration for a named key
300 sequence.</TD>
301 </TR>
302 <TR BGCOLOR="white" CLASS="TableRowColor">
303 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
304 <CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
305 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getStoreName()">getStoreName</A></B>()</CODE>
306
307 <BR>
308 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the name of this store.</TD>
309 </TR>
310 <TR BGCOLOR="white" CLASS="TableRowColor">
311 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
312 <CODE>
313 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
314 <TR ALIGN="right" VALIGN="">
315 <TD NOWRAP><FONT SIZE="-1">
316 <CODE>&lt;SK,PK,E1,E2 extends E1&gt;
317 <BR>
318 <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</A>&lt;SK,PK,E2&gt;</CODE></FONT></TD>
319 </TR>
320 </TABLE>
321 </CODE></FONT></TD>
322 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#getSubclassIndex(com.sleepycat.persist.PrimaryIndex, java.lang.Class, java.lang.Class, java.lang.String)">getSubclassIndex</A></B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</A>&lt;PK,E1&gt;&nbsp;primaryIndex,
323 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;E2&gt;&nbsp;entitySubclass,
324 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;SK&gt;&nbsp;keyClass,
325 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;keyName)</CODE>
326
327 <BR>
328 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a secondary index for a secondary key in an entity subclass,
329 opening it if necessary.</TD>
330 </TR>
331 <TR BGCOLOR="white" CLASS="TableRowColor">
332 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
333 <CODE>&nbsp;void</CODE></FONT></TD>
334 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#setPrimaryConfig(java.lang.Class, com.sleepycat.db.DatabaseConfig)">setPrimaryConfig</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass,
335 <A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A>&nbsp;config)</CODE>
336
337 <BR>
338 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures the primary database for an entity class using the Berkeley
339 DB engine API.</TD>
340 </TR>
341 <TR BGCOLOR="white" CLASS="TableRowColor">
342 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
343 <CODE>&nbsp;void</CODE></FONT></TD>
344 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#setSecondaryConfig(java.lang.Class, java.lang.String, com.sleepycat.db.SecondaryConfig)">setSecondaryConfig</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass,
345 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;keyName,
346 <A HREF="../../../com/sleepycat/db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</A>&nbsp;config)</CODE>
347
348 <BR>
349 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures a secondary database for an entity class and key name using
350 the Berkeley DB engine API.</TD>
351 </TR>
352 <TR BGCOLOR="white" CLASS="TableRowColor">
353 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
354 <CODE>&nbsp;void</CODE></FONT></TD>
355 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#setSequenceConfig(java.lang.String, com.sleepycat.db.SequenceConfig)">setSequenceConfig</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
356 <A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</A>&nbsp;config)</CODE>
357
358 <BR>
359 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures a named key sequence using the Berkeley DB engine API.</TD>
360 </TR>
361 <TR BGCOLOR="white" CLASS="TableRowColor">
362 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
363 <CODE>&nbsp;void</CODE></FONT></TD>
364 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#truncateClass(java.lang.Class)">truncateClass</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass)</CODE>
365
366 <BR>
367 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deletes all instances of this entity class and its (non-entity)
368 subclasses.</TD>
369 </TR>
370 <TR BGCOLOR="white" CLASS="TableRowColor">
371 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
372 <CODE>&nbsp;void</CODE></FONT></TD>
373 <TD><CODE><B><A HREF="../../../com/sleepycat/persist/EntityStore.html#truncateClass(com.sleepycat.db.Transaction, java.lang.Class)">truncateClass</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
374 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass)</CODE>
375
376 <BR>
377 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Deletes all instances of this entity class and its (non-entity)
378 subclasses.</TD>
379 </TR>
380 </TABLE>
381 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
382 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
383 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
384 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
385 </TR>
386 <TR BGCOLOR="white" CLASS="TableRowColor">
387 <TD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
388 </TR>
389 </TABLE>
390 &nbsp;
391 <P>
392
393 <!-- ========= CONSTRUCTOR DETAIL ======== -->
394
395 <A NAME="constructor_detail"><!-- --></A>
396 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
397 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
398 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
399 <B>Constructor Detail</B></FONT></TH>
400 </TR>
401 </TABLE>
402
403 <A NAME="EntityStore(com.sleepycat.db.Environment, java.lang.String, com.sleepycat.persist.StoreConfig)"><!-- --></A><H3>
404 EntityStore</H3>
405 <PRE>
406 public <B>EntityStore</B>(<A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db">Environment</A>&nbsp;env,
407 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;storeName,
408 <A HREF="../../../com/sleepycat/persist/StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</A>&nbsp;config)
409 throws <A HREF="../../../com/sleepycat/persist/StoreExistsException.html" title="class in com.sleepycat.persist">StoreExistsException</A>,
410 <A HREF="../../../com/sleepycat/persist/StoreNotFoundException.html" title="class in com.sleepycat.persist">StoreNotFoundException</A>,
411 <A HREF="../../../com/sleepycat/persist/evolve/IncompatibleClassException.html" title="class in com.sleepycat.persist.evolve">IncompatibleClassException</A>,
412 <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
413 <DL>
414 <DD>Opens an entity store in a given environment.
415 <P>
416 <DL>
417 <DT><B>Parameters:</B><DD><CODE>env</CODE> - an open Berkeley DB Environment.<DD><CODE>storeName</CODE> - the name of the entity store within the given
418 environment. An empty string is allowed. Named stores may be used to
419 distinguish multiple sets of persistent entities for the same entity
420 classes in a single environment. Underlying database names are prefixed
421 with the store name.<DD><CODE>config</CODE> - the entity store configuration, or null to use default
422 configuration properties.
423 <DT><B>Throws:</B>
424 <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
425 been made and mutations are not configured for handling the change. See
426 <A HREF="../../../com/sleepycat/persist/evolve/package-summary.html"><CODE>Class Evolution</CODE></A> for more
427 information.
428 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.
429 <DD><CODE><A HREF="../../../com/sleepycat/persist/StoreExistsException.html" title="class in com.sleepycat.persist">StoreExistsException</A></CODE>
430 <DD><CODE><A HREF="../../../com/sleepycat/persist/StoreNotFoundException.html" title="class in com.sleepycat.persist">StoreNotFoundException</A></CODE></DL>
431 </DL>
432
433 <!-- ============ METHOD DETAIL ========== -->
434
435 <A NAME="method_detail"><!-- --></A>
436 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
437 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
438 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
439 <B>Method Detail</B></FONT></TH>
440 </TR>
441 </TABLE>
442
443 <A NAME="getEnvironment()"><!-- --></A><H3>
444 getEnvironment</H3>
445 <PRE>
446 public <A HREF="../../../com/sleepycat/db/Environment.html" title="class in com.sleepycat.db">Environment</A> <B>getEnvironment</B>()</PRE>
447 <DL>
448 <DD>Returns the environment associated with this store.
449 <P>
450 <DD><DL>
451
452 <DT><B>Returns:</B><DD>the environment.</DL>
453 </DD>
454 </DL>
455 <HR>
456
457 <A NAME="getConfig()"><!-- --></A><H3>
458 getConfig</H3>
459 <PRE>
460 public <A HREF="../../../com/sleepycat/persist/StoreConfig.html" title="class in com.sleepycat.persist">StoreConfig</A> <B>getConfig</B>()</PRE>
461 <DL>
462 <DD>Returns a copy of the entity store configuration.
463 <P>
464 <DD><DL>
465
466 <DT><B>Returns:</B><DD>the config.</DL>
467 </DD>
468 </DL>
469 <HR>
470
471 <A NAME="getStoreName()"><!-- --></A><H3>
472 getStoreName</H3>
473 <PRE>
474 public <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getStoreName</B>()</PRE>
475 <DL>
476 <DD>Returns the name of this store.
477 <P>
478 <DD><DL>
479
480 <DT><B>Returns:</B><DD>the name.</DL>
481 </DD>
482 </DL>
483 <HR>
484
485 <A NAME="getModel()"><!-- --></A><H3>
486 getModel</H3>
487 <PRE>
488 public <A HREF="../../../com/sleepycat/persist/model/EntityModel.html" title="class in com.sleepycat.persist.model">EntityModel</A> <B>getModel</B>()</PRE>
489 <DL>
490 <DD>Returns the current entity model for this store. The current model is
491 derived from the configured entity model and the live entity class
492 definitions.
493 <P>
494 <DD><DL>
495
496 <DT><B>Returns:</B><DD>the model.</DL>
497 </DD>
498 </DL>
499 <HR>
500
501 <A NAME="getMutations()"><!-- --></A><H3>
502 getMutations</H3>
503 <PRE>
504 public <A HREF="../../../com/sleepycat/persist/evolve/Mutations.html" title="class in com.sleepycat.persist.evolve">Mutations</A> <B>getMutations</B>()</PRE>
505 <DL>
506 <DD>Returns the set of mutations that were configured when the store was
507 opened, or if none were configured, the set of mutations that were
508 configured and stored previously.
509 <P>
510 <DD><DL>
511
512 <DT><B>Returns:</B><DD>the mutations.</DL>
513 </DD>
514 </DL>
515 <HR>
516
517 <A NAME="getPrimaryIndex(java.lang.Class, java.lang.Class)"><!-- --></A><H3>
518 getPrimaryIndex</H3>
519 <PRE>
520 public &lt;PK,E&gt; <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</A>&lt;PK,E&gt; <B>getPrimaryIndex</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;PK&gt;&nbsp;primaryKeyClass,
521 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;E&gt;&nbsp;entityClass)
522 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
523 <DL>
524 <DD>Returns the primary index for a given entity class, opening it if
525 necessary.
526
527 <p>If they are not already open, the primary and secondary databases for
528 the entity class are created/opened together in a single internal
529 transaction. When the secondary indices are opened, that can cascade to
530 open other related primary indices.</p>
531 <P>
532 <DD><DL>
533 <DT><B>Parameters:</B><DD><CODE>primaryKeyClass</CODE> - the class of the entity's primary key field, or
534 the corresponding primitive wrapper class if the primary key field type
535 is a primitive.<DD><CODE>entityClass</CODE> - the entity class for which to open the primary index.
536 <DT><B>Returns:</B><DD>the primary index.
537 <DT><B>Throws:</B>
538 <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the entity class or classes
539 referenced by it are not persistent, or the primary key class does not
540 match the entity's primary key field, or if metadata for the entity or
541 primary key is invalid.
542 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL>
543 </DD>
544 </DL>
545 <HR>
546
547 <A NAME="getSecondaryIndex(com.sleepycat.persist.PrimaryIndex, java.lang.Class, java.lang.String)"><!-- --></A><H3>
548 getSecondaryIndex</H3>
549 <PRE>
550 public &lt;SK,PK,E&gt; <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</A>&lt;SK,PK,E&gt; <B>getSecondaryIndex</B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</A>&lt;PK,E&gt;&nbsp;primaryIndex,
551 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;SK&gt;&nbsp;keyClass,
552 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;keyName)
553 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
554 <DL>
555 <DD>Returns a secondary index for a given primary index and secondary key,
556 opening it if necessary.
557
558 <p><em>NOTE:</em> If the secondary key field is declared in a subclass
559 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<PK, E1>, java.lang.Class<E2>, java.lang.Class<SK>, java.lang.String)</CODE></A> instead.</p>
560
561 <p>If a <A HREF="../../../com/sleepycat/persist/model/SecondaryKey.html#relatedEntity()"><CODE>SecondaryKey.relatedEntity()</CODE></A> is used and the primary index
562 for the related entity is not already open, it will be opened by this
563 method. That will, in turn, open its secondary indices, which can
564 cascade to open other primary indices.</p>
565 <P>
566 <DD><DL>
567 <DT><B>Parameters:</B><DD><CODE>primaryIndex</CODE> - the primary index associated with the returned
568 secondary index. The entity class of the primary index, or one of its
569 superclasses, must contain a secondary key with the given secondary key
570 class and key name.<DD><CODE>keyClass</CODE> - the class of the secondary key field, or the
571 corresponding primitive wrapper class if the secondary key field type is
572 a primitive.<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.
573 <DT><B>Returns:</B><DD>the secondary index.
574 <DT><B>Throws:</B>
575 <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the entity class or one of its
576 superclasses does not contain a key field of the given key class and key
577 name, or if the metadata for the secondary key is invalid.
578 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL>
579 </DD>
580 </DL>
581 <HR>
582
583 <A NAME="getSubclassIndex(com.sleepycat.persist.PrimaryIndex, java.lang.Class, java.lang.Class, java.lang.String)"><!-- --></A><H3>
584 getSubclassIndex</H3>
585 <PRE>
586 public &lt;SK,PK,E1,E2 extends E1&gt; <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist">SecondaryIndex</A>&lt;SK,PK,E2&gt; <B>getSubclassIndex</B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist">PrimaryIndex</A>&lt;PK,E1&gt;&nbsp;primaryIndex,
587 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;E2&gt;&nbsp;entitySubclass,
588 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;SK&gt;&nbsp;keyClass,
589 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;keyName)
590 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
591 <DL>
592 <DD>Returns a secondary index for a secondary key in an entity subclass,
593 opening it if necessary.
594
595 <p>If a <A HREF="../../../com/sleepycat/persist/model/SecondaryKey.html#relatedEntity()"><CODE>SecondaryKey.relatedEntity()</CODE></A> is used and the primary index
596 for the related entity is not already open, it will be opened by this
597 method. That will, in turn, open its secondary indices, which can
598 cascade to open other primary indices.</p>
599 <P>
600 <DD><DL>
601 <DT><B>Parameters:</B><DD><CODE>primaryIndex</CODE> - the primary index associated with the returned
602 secondary index. The entity class of the primary index, or one of its
603 superclasses, must contain a secondary key with the given secondary key
604 class and key name.<DD><CODE>entitySubclass</CODE> - a subclass of the entity class for the primary
605 index. The entity subclass must contain a secondary key with the given
606 secondary key class and key name.<DD><CODE>keyClass</CODE> - the class of the secondary key field, or the
607 corresponding primitive wrapper class if the secondary key field type is
608 a primitive.<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.
609 <DT><B>Returns:</B><DD>the secondary index.
610 <DT><B>Throws:</B>
611 <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the given entity subclass does not
612 contain a key field of the given key class and key name, or if the
613 metadata for the secondary key is invalid.
614 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL>
615 </DD>
616 </DL>
617 <HR>
618
619 <A NAME="evolve(com.sleepycat.persist.evolve.EvolveConfig)"><!-- --></A><H3>
620 evolve</H3>
621 <PRE>
622 public <A HREF="../../../com/sleepycat/persist/evolve/EvolveStats.html" title="class in com.sleepycat.persist.evolve">EvolveStats</A> <B>evolve</B>(<A HREF="../../../com/sleepycat/persist/evolve/EvolveConfig.html" title="class in com.sleepycat.persist.evolve">EvolveConfig</A>&nbsp;config)
623 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
624 <DL>
625 <DD>Performs conversion of unevolved objects in order to reduce lazy
626 conversion overhead. Evolution may be performed concurrently with
627 normal access to the store.
628
629 <p>Conversion is performed one entity class at a time. An entity class
630 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
631 <A HREF="../../../com/sleepycat/persist/StoreConfig.html#setMutations(com.sleepycat.persist.evolve.Mutations)"><CODE>StoreConfig.setMutations</CODE></A>.</p>
632
633 <p>Conversion of an entity class is performed by reading each entity,
634 converting it if necessary, and updating it if conversion was performed.
635 When all instances of an entity class are converted, references to the
636 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
637 called twice successfully without changing class definitions, the second
638 call will do nothing.</p>
639 <P>
640 <DD><DL>
641
642 <DT><B>Throws:</B>
643 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.<DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/persist/evolve/package-summary.html"><CODE>Class Evolution</CODE></A></DL>
644 </DD>
645 </DL>
646 <HR>
647
648 <A NAME="truncateClass(java.lang.Class)"><!-- --></A><H3>
649 truncateClass</H3>
650 <PRE>
651 public void <B>truncateClass</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass)
652 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
653 <DL>
654 <DD>Deletes all instances of this entity class and its (non-entity)
655 subclasses.
656
657 <p>The primary database for the given entity class will be truncated and
658 all secondary databases will be removed. The primary and secondary
659 databases associated with the entity class must not be open except by
660 this store, since database truncation/removal is only possible when the
661 database is not open.</p>
662
663 <p>The primary and secondary databases for the entity class will be
664 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
665 <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><CODE>SecondaryIndex</CODE></A> objects will be invalidated. To access the
666 indexes, the user must call <A HREF="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex(java.lang.Class, java.lang.Class)"><CODE>getPrimaryIndex(java.lang.Class<PK>, java.lang.Class<E>)</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<PK, E>, java.lang.Class<SK>, java.lang.String)</CODE></A> after this operation is complete.</p>
667
668 <p>Auto-commit is used implicitly if the store is transactional.</p>
669 <P>
670 <DD><DL>
671 <DT><B>Parameters:</B><DD><CODE>entityClass</CODE> - the entity class whose instances are to be deleted.
672 <DT><B>Throws:</B>
673 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL>
674 </DD>
675 </DL>
676 <HR>
677
678 <A NAME="truncateClass(com.sleepycat.db.Transaction, java.lang.Class)"><!-- --></A><H3>
679 truncateClass</H3>
680 <PRE>
681 public void <B>truncateClass</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A>&nbsp;txn,
682 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass)
683 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
684 <DL>
685 <DD>Deletes all instances of this entity class and its (non-entity)
686 subclasses.
687
688 <p>The primary database for the given entity class will be truncated and
689 all secondary databases will be removed. The primary and secondary
690 databases associated with the entity class must not be open except by
691 this store, since database truncation/removal is only possible when the
692 database is not open.</p>
693
694 <p>The primary and secondary databases for the entity class will be
695 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
696 <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><CODE>SecondaryIndex</CODE></A> objects will be invalidated. To access the
697 indexes, the user must call <A HREF="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex(java.lang.Class, java.lang.Class)"><CODE>getPrimaryIndex(java.lang.Class<PK>, java.lang.Class<E>)</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<PK, E>, java.lang.Class<SK>, java.lang.String)</CODE></A> after this operation is complete.</p>
698 <P>
699 <DD><DL>
700 <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, null to use
701 auto-commit, or null if the store is non-transactional.<DD><CODE>entityClass</CODE> - the entity class whose instances are to be deleted.
702 <DT><B>Throws:</B>
703 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL>
704 </DD>
705 </DL>
706 <HR>
707
708 <A NAME="closeClass(java.lang.Class)"><!-- --></A><H3>
709 closeClass</H3>
710 <PRE>
711 public void <B>closeClass</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass)
712 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
713 <DL>
714 <DD>Closes the primary and secondary databases for the given entity class
715 that were opened via this store. The caller must ensure that the
716 primary and secondary indices for the entity class are no longer in
717 use.
718
719 <p>The primary and secondary databases for the entity class will be
720 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
721 <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><CODE>SecondaryIndex</CODE></A> objects will be invalidated. To access the
722 indexes, the user must call <A HREF="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex(java.lang.Class, java.lang.Class)"><CODE>getPrimaryIndex(java.lang.Class<PK>, java.lang.Class<E>)</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<PK, E>, java.lang.Class<SK>, java.lang.String)</CODE></A> after this operation is complete.</p>
723 <P>
724 <DD><DL>
725 <DT><B>Parameters:</B><DD><CODE>entityClass</CODE> - the entity class whose databases are to be closed.
726 <DT><B>Throws:</B>
727 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL>
728 </DD>
729 </DL>
730 <HR>
731
732 <A NAME="close()"><!-- --></A><H3>
733 close</H3>
734 <PRE>
735 public void <B>close</B>()
736 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
737 <DL>
738 <DD>Closes all databases and sequences that were opened via this store. The
739 caller must ensure that no databases opened via this store are in use.
740
741 <p>WARNING: To guard against memory leaks, the application should
742 discard all references to the closed handle. While BDB makes an effort
743 to discard references from closed objects to the allocated memory for an
744 environment, this behavior is not guaranteed. The safe course of action
745 for an application is to discard all references to closed BDB
746 objects.</p>
747 <P>
748 <DD><DL>
749
750 <DT><B>Throws:</B>
751 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL>
752 </DD>
753 </DL>
754 <HR>
755
756 <A NAME="getSequence(java.lang.String)"><!-- --></A><H3>
757 getSequence</H3>
758 <PRE>
759 public <A HREF="../../../com/sleepycat/db/Sequence.html" title="class in com.sleepycat.db">Sequence</A> <B>getSequence</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)
760 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE>
761 <DL>
762 <DD>Returns a named sequence for using Berkeley DB engine API directly,
763 opening it if necessary.
764 <P>
765 <DD><DL>
766 <DT><B>Parameters:</B><DD><CODE>name</CODE> - the sequence name, which is normally defined using the
767 <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> annotation property.
768 <DT><B>Returns:</B><DD>the open sequence for the given sequence name.
769 <DT><B>Throws:</B>
770 <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE> - the base class for all BDB exceptions.</DL>
771 </DD>
772 </DL>
773 <HR>
774
775 <A NAME="getSequenceConfig(java.lang.String)"><!-- --></A><H3>
776 getSequenceConfig</H3>
777 <PRE>
778 public <A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</A> <B>getSequenceConfig</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</PRE>
779 <DL>
780 <DD>Returns the default Berkeley DB engine API configuration for a named key
781 sequence.
782
783 </p>The returned configuration is as follows. All other properties have
784 default values.</p>
785 <ul>
786 <li>The <A HREF="../../../com/sleepycat/db/SequenceConfig.html#setInitialValue(long)"><CODE>InitialValue</CODE></A> is one.</li>
787 <li>The <A HREF="../../../com/sleepycat/db/SequenceConfig.html#setRange(long, long)"><CODE>Range</CODE></A> minimum is one.</li>
788 <li>The <A HREF="../../../com/sleepycat/db/SequenceConfig.html#setCacheSize(int)"><CODE>CacheSize</CODE></A> is 100.</li>
789 <li><A HREF="../../../com/sleepycat/db/SequenceConfig.html#setAutoCommitNoSync(boolean)"><CODE>AutoCommitNoSync</CODE></A> is
790 true.</li>
791 <li><A HREF="../../../com/sleepycat/db/SequenceConfig.html#setAllowCreate(boolean)"><CODE>AllowCreate</CODE></A> is set to the
792 inverse of the store <A HREF="../../../com/sleepycat/persist/StoreConfig.html#setReadOnly(boolean)"><CODE>ReadOnly</CODE></A>.
793 setting.</li>
794 </ul>
795 <P>
796 <DD><DL>
797 <DT><B>Parameters:</B><DD><CODE>name</CODE> - the sequence name, which is normally defined using the
798 <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> annotation property.
799 <DT><B>Returns:</B><DD>the default configuration for the given sequence name.</DL>
800 </DD>
801 </DL>
802 <HR>
803
804 <A NAME="setSequenceConfig(java.lang.String, com.sleepycat.db.SequenceConfig)"><!-- --></A><H3>
805 setSequenceConfig</H3>
806 <PRE>
807 public void <B>setSequenceConfig</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
808 <A HREF="../../../com/sleepycat/db/SequenceConfig.html" title="class in com.sleepycat.db">SequenceConfig</A>&nbsp;config)</PRE>
809 <DL>
810 <DD>Configures a named key sequence using the Berkeley DB engine API.
811
812 <p>To be compatible with the entity model and the Direct Persistence
813 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
814 method. The following configuration properties may not be changed:</p>
815 <ul>
816 <li><A HREF="../../../com/sleepycat/db/SequenceConfig.html#setExclusiveCreate(boolean)"><CODE>ExclusiveCreate</CODE></A></li>
817 </ul>
818 <p>In addition, <A HREF="../../../com/sleepycat/db/SequenceConfig.html#setAllowCreate(boolean)"><CODE>AllowCreate</CODE></A> must be
819 the inverse of <code>ReadOnly</code></p>
820
821 <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>
822 <P>
823 <DD><DL>
824 <DT><B>Parameters:</B><DD><CODE>name</CODE> - the sequence name, which is normally defined using the
825 <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> annotation property.<DD><CODE>config</CODE> - the configuration to use for the given sequence name.
826 <DT><B>Throws:</B>
827 <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the configuration is incompatible
828 with the entity model or the Direct Persistence Layer.
829 <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the sequence has already been opened.</DL>
830 </DD>
831 </DL>
832 <HR>
833
834 <A NAME="getPrimaryConfig(java.lang.Class)"><!-- --></A><H3>
835 getPrimaryConfig</H3>
836 <PRE>
837 public <A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A> <B>getPrimaryConfig</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass)</PRE>
838 <DL>
839 <DD>Returns the default primary database Berkeley DB engine API
840 configuration for an entity class.
841
842 </p>The returned configuration is as follows. All other properties have
843 default values.</p>
844 <ul>
845 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setTransactional(boolean)"><CODE>Transactional</CODE></A> is set to
846 match <A HREF="../../../com/sleepycat/persist/StoreConfig.html#setTransactional(boolean)"><CODE>StoreConfig</CODE></A>.</li>
847 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setAllowCreate(boolean)"><CODE>AllowCreate</CODE></A> is set to the
848 inverse of the store <A HREF="../../../com/sleepycat/persist/StoreConfig.html#setReadOnly(boolean)"><CODE>ReadOnly</CODE></A>.
849 setting.</li>
850 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setReadOnly(boolean)"><CODE>ReadOnly</CODE></A> is set to match
851 <A HREF="../../../com/sleepycat/persist/StoreConfig.html#setReadOnly(boolean)"><CODE>StoreConfig</CODE></A>.</li>
852 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setBtreeComparator(java.util.Comparator)"><CODE>BtreeComparator</CODE></A> is set to
853 an internal class if a key comparator is used.</li>
854 </ul>
855 <P>
856 <DD><DL>
857 <DT><B>Parameters:</B><DD><CODE>entityClass</CODE> - the entity class identifying the primary database.
858 <DT><B>Returns:</B><DD>the default configuration for the given entity class.</DL>
859 </DD>
860 </DL>
861 <HR>
862
863 <A NAME="setPrimaryConfig(java.lang.Class, com.sleepycat.db.DatabaseConfig)"><!-- --></A><H3>
864 setPrimaryConfig</H3>
865 <PRE>
866 public void <B>setPrimaryConfig</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass,
867 <A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db">DatabaseConfig</A>&nbsp;config)</PRE>
868 <DL>
869 <DD>Configures the primary database for an entity class using the Berkeley
870 DB engine API.
871
872 <p>To be compatible with the entity model and the Direct Persistence
873 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
874 method. The following configuration properties may not be changed:</p>
875 <ul>
876 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setExclusiveCreate(boolean)"><CODE>ExclusiveCreate</CODE></A></li>
877 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setSortedDuplicates(boolean)"><CODE>SortedDuplicates</CODE></A></li>
878 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setBtreeComparator(java.util.Comparator)"><CODE>BtreeComparator</CODE></A></li>
879 </ul>
880 <p>In addition, <A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setAllowCreate(boolean)"><CODE>AllowCreate</CODE></A> must be
881 the inverse of <code>ReadOnly</code></p>
882 <P>
883 <DD><DL>
884 <DT><B>Parameters:</B><DD><CODE>entityClass</CODE> - the entity class identifying the primary database.<DD><CODE>config</CODE> - the configuration to use for the given entity class.
885 <DT><B>Throws:</B>
886 <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the configuration is incompatible
887 with the entity model or the Direct Persistence Layer.
888 <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the database has already been opened.</DL>
889 </DD>
890 </DL>
891 <HR>
892
893 <A NAME="getSecondaryConfig(java.lang.Class, java.lang.String)"><!-- --></A><H3>
894 getSecondaryConfig</H3>
895 <PRE>
896 public <A HREF="../../../com/sleepycat/db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</A> <B>getSecondaryConfig</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass,
897 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;keyName)</PRE>
898 <DL>
899 <DD>Returns the default secondary database Berkeley DB engine API
900 configuration for an entity class and key name.
901
902 </p>The returned configuration is as follows. All other properties have
903 default values.</p>
904 <ul>
905 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setTransactional(boolean)"><CODE>Transactional</CODE></A> is set to
906 match the primary database.</li>
907 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setAllowCreate(boolean)"><CODE>AllowCreate</CODE></A> is set to the
908 inverse of the primary database <A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setReadOnly(boolean)"><CODE>ReadOnly</CODE></A> setting.</li>
909 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setReadOnly(boolean)"><CODE>ReadOnly</CODE></A> is set to match
910 the primary database.</li>
911 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setBtreeComparator(java.util.Comparator)"><CODE>BtreeComparator</CODE></A> is set to
912 an internal class if a key comparator is used.</li>
913 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setSortedDuplicates(boolean)"><CODE>SortedDuplicates</CODE></A> is set
914 according to <A HREF="../../../com/sleepycat/persist/model/SecondaryKey.html#relate()"><CODE>SecondaryKey.relate()</CODE></A>.</p>
915 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setAllowPopulate(boolean)"><CODE>AllowPopulate</CODE></A> is set to
916 true when a secondary key is added to an existing primary index.</li>
917 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setKeyCreator(com.sleepycat.db.SecondaryKeyCreator)"><CODE>KeyCreator</CODE></A> or <A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setMultiKeyCreator(com.sleepycat.db.SecondaryMultiKeyCreator)"><CODE>MultiKeyCreator</CODE></A> is set to an
918 internal instance.</p>
919 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setForeignMultiKeyNullifier(com.sleepycat.db.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>
920 </ul>
921 <P>
922 <DD><DL>
923 <DT><B>Parameters:</B><DD><CODE>entityClass</CODE> - the entity class containing the given secondary key
924 name.<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.
925 <DT><B>Returns:</B><DD>the default configuration for the given secondary key.</DL>
926 </DD>
927 </DL>
928 <HR>
929
930 <A NAME="setSecondaryConfig(java.lang.Class, java.lang.String, com.sleepycat.db.SecondaryConfig)"><!-- --></A><H3>
931 setSecondaryConfig</H3>
932 <PRE>
933 public void <B>setSecondaryConfig</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;entityClass,
934 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;keyName,
935 <A HREF="../../../com/sleepycat/db/SecondaryConfig.html" title="class in com.sleepycat.db">SecondaryConfig</A>&nbsp;config)</PRE>
936 <DL>
937 <DD>Configures a secondary database for an entity class and key name using
938 the Berkeley DB engine API.
939
940 <p>To be compatible with the entity model and the Direct Persistence
941 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
942 this method. The following configuration properties may not be
943 changed:</p>
944 <ul>
945 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setExclusiveCreate(boolean)"><CODE>ExclusiveCreate</CODE></A></li>
946 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setSortedDuplicates(boolean)"><CODE>SortedDuplicates</CODE></A></li>
947 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setBtreeComparator(java.util.Comparator)"><CODE>BtreeComparator</CODE></A></li>
948 <li><A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setDuplicateComparator(java.util.Comparator)"><CODE>DuplicateComparator</CODE></A></li>
949 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setAllowPopulate(boolean)"><CODE>AllowPopulate</CODE></A></li>
950 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setKeyCreator(com.sleepycat.db.SecondaryKeyCreator)"><CODE>KeyCreator</CODE></A></li>
951 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setMultiKeyCreator(com.sleepycat.db.SecondaryMultiKeyCreator)"><CODE>MultiKeyCreator</CODE></A></li>
952 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setForeignKeyNullifier(com.sleepycat.db.ForeignKeyNullifier)"><CODE>ForeignKeyNullifier</CODE></A></li>
953 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setForeignMultiKeyNullifier(com.sleepycat.db.ForeignMultiKeyNullifier)"><CODE>ForeignMultiKeyNullifier</CODE></A></li>
954 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setForeignKeyDeleteAction(com.sleepycat.db.ForeignKeyDeleteAction)"><CODE>ForeignKeyDeleteAction</CODE></A></li>
955 <li><A HREF="../../../com/sleepycat/db/SecondaryConfig.html#setForeignKeyDatabase(com.sleepycat.db.Database)"><CODE>ForeignKeyDatabase</CODE></A></li>
956 </ul>
957 <p>In addition, <A HREF="../../../com/sleepycat/db/DatabaseConfig.html#setAllowCreate(boolean)"><CODE>AllowCreate</CODE></A> must be
958 the inverse of <code>ReadOnly</code></p>
959 <P>
960 <DD><DL>
961 <DT><B>Parameters:</B><DD><CODE>entityClass</CODE> - the entity class containing the given secondary key
962 name.<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><CODE>config</CODE> - the configuration to use for the given secondary key.
963 <DT><B>Throws:</B>
964 <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the configuration is incompatible
965 with the entity model or the Direct Persistence Layer.
966 <DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if the database has already been opened.</DL>
967 </DD>
968 </DL>
969 <!-- ========= END OF CLASS DATA ========= -->
970 <HR>
971
972
973 <!-- ======= START OF BOTTOM NAVBAR ====== -->
974 <A NAME="navbar_bottom"><!-- --></A>
975 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
976 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
977 <TR>
978 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
979 <A NAME="navbar_bottom_firstrow"><!-- --></A>
980 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
981 <TR ALIGN="center" VALIGN="top">
982 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
983 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
984 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
985 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EntityStore.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
986 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
987 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
988 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
989 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
990 </TR>
991 </TABLE>
992 </TD>
993 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
994 <b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM>
995 </TD>
996 </TR>
997
998 <TR>
999 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1000 &nbsp;<A HREF="../../../com/sleepycat/persist/EntityJoin.html" title="class in com.sleepycat.persist"><B>PREV CLASS</B></A>&nbsp;
1001 &nbsp;<A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist"><B>NEXT CLASS</B></A></FONT></TD>
1002 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1003 <A HREF="../../../index.html?com/sleepycat/persist/EntityStore.html" target="_top"><B>FRAMES</B></A> &nbsp;
1004 &nbsp;<A HREF="EntityStore.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
1005 &nbsp;<SCRIPT type="text/javascript">
1006 <!--
1007 if(window==top) {
1008 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
1009 }
1010 //-->
1011 </SCRIPT>
1012 <NOSCRIPT>
1013 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
1014 </NOSCRIPT>
1015
1016
1017 </FONT></TD>
1018 </TR>
1019 <TR>
1020 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1021 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
1022 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1023 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
1024 </TR>
1025 </TABLE>
1026 <A NAME="skip-navbar_bottom"></A>
1027 <!-- ======== END OF BOTTOM NAVBAR ======= -->
1028
1029 <HR>
1030 <font size=1>Copyright (c) 1996, 2013 Oracle and/or its affiliates. All rights reserved.</font>
1031 </BODY>
1032 </HTML>