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_03) on Mon Apr 12 16:25:50 EDT 2010 --> 6<TITLE> 7PrimaryIndex (Oracle - Berkeley DB Java API) 8</TITLE> 9 10<META NAME="date" CONTENT="2010-04-12"> 11 12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style"> 13 14<SCRIPT type="text/javascript"> 15function windowTitle() 16{ 17 if (location.href.indexOf('is-external=true') == -1) { 18 parent.document.title="PrimaryIndex (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> </TD> 41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PrimaryIndex.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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 4.8.30</font></EM> 53</TD> 54</TR> 55 56<TR> 57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 58 <A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A> 59 <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class 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/PrimaryIndex.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="PrimaryIndex.html" target="_top"><B>NO FRAMES</B></A> 63 <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 81DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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"> 91com.sleepycat.persist</FONT> 92<BR> 93Class PrimaryIndex<PK,E></H2> 94<PRE> 95<A HREF="http://java.sun.com/j2se/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.PrimaryIndex<PK,E></B> 97</PRE> 98<DL> 99<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><PK,E></DD> 100</DL> 101<HR> 102<DL> 103<DT><PRE>public class <B>PrimaryIndex<PK,E></B><DT>extends <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> 104</PRE> 105 106<P> 107The primary index for an entity class and its primary key. 108 109 <p><code>PrimaryIndex</code> objects are thread-safe. Multiple threads may 110 safely call the methods of a shared <code>PrimaryIndex</code> object.</p> 111 112 <p><code>PrimaryIndex</code> implements <A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist"><CODE>EntityIndex</CODE></A> to map the primary 113 key type (PK) to the entity type (E).</p> 114 115 <p>The <A HREF="../../../com/sleepycat/persist/model/Entity.html" title="annotation in com.sleepycat.persist.model"><CODE>Entity</CODE></A> annotation may be used to define an entity class and 116 the <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html" title="annotation in com.sleepycat.persist.model"><CODE>PrimaryKey</CODE></A> annotation may be used to define a primary key as 117 shown in the following example.</p> 118 119 <pre class="code"> 120 @Entity 121 class Employee { 122 123 @PrimaryKey 124 long id; 125 126 String name; 127 128 Employee(long id, String name) { 129 this.id = id; 130 this.name = name; 131 } 132 133 private Employee() {} // For bindings 134 }</pre> 135 136 <p>To obtain the <code>PrimaryIndex</code> for a given entity class, call <A HREF="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex(java.lang.Class, java.lang.Class)"><CODE>EntityStore.getPrimaryIndex</CODE></A>, passing the 137 primary key class and the entity class. For example:</p> 138 139 <pre class="code"> 140 EntityStore store = new EntityStore(...); 141 142 <code>PrimaryIndex<Long,Employee></code> primaryIndex = 143 store.getPrimaryIndex(Long.class, Employee.class);</pre> 144 </pre> 145 146 <p>Note that <code>Long.class</code> is passed as the primary key class, but the 147 primary key field has the primitive type <code>long</code>. When a primitive 148 primary key field is used, the corresponding primitive wrapper class is used 149 to access the primary index. For more information on key field types, see 150 <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html" title="annotation in com.sleepycat.persist.model"><CODE>PrimaryKey</CODE></A>.</p> 151 152 <p>The <code>PrimaryIndex</code> provides the primary storage and access methods 153 for the instances of a particular entity class. Entities are inserted and 154 updated in the <code>PrimaryIndex</code> by calling a method in the family of 155 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(E)"><CODE>put(E)</CODE></A> methods. The <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(E)"><CODE>put(E)</CODE></A> method will insert the entity if no 156 entity with the same primary key already exists. If an entity with the same 157 primary key does exist, it will update the entity and return the existing 158 (old) entity. For example:</p> 159 160 <pre class="code"> 161 Employee oldEntity; 162 oldEntity = primaryIndex.put(new Employee(1, "Jane Smith")); // Inserts an entity 163 assert oldEntity == null; 164 oldEntity = primaryIndex.put(new Employee(2, "Joan Smith")); // Inserts an entity 165 assert oldEntity == null; 166 oldEntity = primaryIndex.put(new Employee(2, "Joan M. Smith")); // Updates an entity 167 assert oldEntity != null;</pre> 168 169 <p>The <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoReturn(E)"><CODE>putNoReturn(E)</CODE></A> method can be used to avoid the overhead of 170 returning the existing entity, when the existing entity is not important to 171 the application. The return type of <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoReturn(E)"><CODE>putNoReturn(E)</CODE></A> is void. For 172 example:</p> 173 174 <pre class="code"> 175 primaryIndex.putNoReturn(new Employee(1, "Jane Smith")); // Inserts an entity 176 primaryIndex.putNoReturn(new Employee(2, "Joan Smith")); // Inserts an entity 177 primaryIndex.putNoReturn(new Employee(2, "Joan M. Smith")); // Updates an entity</pre> 178 179 <p>The <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoOverwrite(E)"><CODE>putNoOverwrite(E)</CODE></A> method can be used to ensure that an existing 180 entity is not overwritten. <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoOverwrite(E)"><CODE>putNoOverwrite(E)</CODE></A> returns true if the 181 entity was inserted, or false if an existing entity exists and no action was 182 taken. For example:<p> 183 184 <pre class="code"> 185 boolean inserted; 186 inserted = primaryIndex.putNoOverwrite(new Employee(1, "Jane Smith")); // Inserts an entity 187 assert inserted; 188 inserted = primaryIndex.putNoOverwrite(new Employee(2, "Joan Smith")); // Inserts an entity 189 assert inserted; 190 inserted = primaryIndex.putNoOverwrite(new Employee(2, "Joan M. Smith")); // <strong>No action was taken!</strong> 191 assert !inserted;</pre> 192 193 <p>Primary key values must be unique, in other words, each instance of a 194 given entity class must have a distinct primary key value. Rather than 195 assigning the unique primary key values yourself, a <em>sequence</em> can be 196 used to assign sequential integer values automatically, starting with the 197 value 1 (one). A sequence is defined using the <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> 198 annotation property. For example:</p> 199 200 <pre class="code"> 201 @Entity 202 class Employee { 203 204 @PrimaryKey(sequence="ID") 205 long id; 206 207 String name; 208 209 Employee(String name) { 210 this.name = name; 211 } 212 213 private Employee() {} // For bindings 214 }</pre> 215 216 <p>The name of the sequence used above is "ID". Any name can be used. If 217 the same sequence name is used in more than one entity class, the sequence 218 will be shared by those classes, in other words, a single sequence of 219 integers will be used for all instances of those classes. See <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> for more information.</p> 220 221 <p>Any method in the family of <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(E)"><CODE>put(E)</CODE></A> methods may be used to insert 222 entities where the primary key is assigned from a sequence. When the <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(E)"><CODE>put(E)</CODE></A> method returns, the primary key field of the entity object will be set 223 to the assigned key value. For example:</p> 224 225 <pre class="code"> 226 Employee employee; 227 employee = new Employee("Jane Smith"); 228 primaryIndex.putNoReturn(employee); // Inserts an entity 229 assert employee.id == 1; 230 employee = new Employee("Joan Smith"); 231 primaryIndex.putNoReturn(employee); // Inserts an entity 232 assert employee.id == 2;</pre> 233 234 <p>This begs the question: How do you update an existing entity, without 235 assigning a new primary key? The answer is that the <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(E)"><CODE>put(E)</CODE></A> methods 236 will only assign a new key from the sequence if the primary key field is 237 zero or null (for reference types). If an entity with a non-zero and 238 non-null key field is passed to a <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(E)"><CODE>put(E)</CODE></A> method, any existing entity 239 with that primary key value will be updated. For example:</p> 240 241 <pre class="code"> 242 Employee employee; 243 employee = new Employee("Jane Smith"); 244 primaryIndex.putNoReturn(employee); // Inserts an entity 245 assert employee.id == 1; 246 employee = new Employee("Joan Smith"); 247 primaryIndex.putNoReturn(employee); // Inserts an entity 248 assert employee.id == 2; 249 employee.name = "Joan M. Smith"; 250 primaryIndex.putNoReturn(employee); // Updates an existing entity 251 assert employee.id == 2;</pre> 252 253 <p>Since <code>PrimaryIndex</code> implements the <A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist"><CODE>EntityIndex</CODE></A> interface, 254 it shares the common index methods for retrieving and deleting entities, 255 opening cursors and using transactions. See <A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist"><CODE>EntityIndex</CODE></A> for more 256 information on these topics.</p> 257 258 <p>Note that when using an index, keys and values are stored and retrieved 259 by value not by reference. In other words, if an entity object is stored 260 and then retrieved, or retrieved twice, each object will be a separate 261 instance. For example, in the code below the assertion will always 262 fail.</p> 263 <pre class="code"> 264 MyKey key = ...; 265 MyEntity entity1 = new MyEntity(key, ...); 266 index.put(entity1); 267 MyEntity entity2 = index.get(key); 268 assert entity1 == entity2; // always fails! 269 </pre> 270<P> 271 272<P> 273<HR> 274 275<P> 276 277<!-- ======== CONSTRUCTOR SUMMARY ======== --> 278 279<A NAME="constructor_summary"><!-- --></A> 280<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 281<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 282<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 283<B>Constructor Summary</B></FONT></TH> 284</TR> 285<TR BGCOLOR="white" CLASS="TableRowColor"> 286<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#PrimaryIndex(com.sleepycat.db.Database, java.lang.Class, com.sleepycat.bind.EntryBinding, java.lang.Class, com.sleepycat.bind.EntityBinding)">PrimaryIndex</A></B>(<A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A> database, 287 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>> keyClass, 288 <A HREF="../../../com/sleepycat/bind/EntryBinding.html" title="interface in com.sleepycat.bind">EntryBinding</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>> keyBinding, 289 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> entityClass, 290 <A HREF="../../../com/sleepycat/bind/EntityBinding.html" title="interface in com.sleepycat.bind">EntityBinding</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> entityBinding)</CODE> 291 292<BR> 293 Creates a primary index without using an <code>EntityStore</code>.</TD> 294</TR> 295</TABLE> 296 297<!-- ========== METHOD SUMMARY =========== --> 298 299<A NAME="method_summary"><!-- --></A> 300<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 301<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 302<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 303<B>Method Summary</B></FONT></TH> 304</TR> 305<TR BGCOLOR="white" CLASS="TableRowColor"> 306<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 307<CODE> boolean</CODE></FONT></TD> 308<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#contains(K)">contains</A></B>(K key)</CODE> 309 310<BR> 311 Checks for existence of a key in this index.</TD> 312</TR> 313<TR BGCOLOR="white" CLASS="TableRowColor"> 314<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 315<CODE> boolean</CODE></FONT></TD> 316<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#contains(com.sleepycat.db.Transaction, K, com.sleepycat.db.LockMode)">contains</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 317 K key, 318 <A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> 319 320<BR> 321 Checks for existence of a key in this index.</TD> 322</TR> 323<TR BGCOLOR="white" CLASS="TableRowColor"> 324<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 325<CODE> long</CODE></FONT></TD> 326<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#count()">count</A></B>()</CODE> 327 328<BR> 329 Returns a non-transactional count of the entities in this index.</TD> 330</TR> 331<TR BGCOLOR="white" CLASS="TableRowColor"> 332<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 333<CODE> boolean</CODE></FONT></TD> 334<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#delete(K)">delete</A></B>(K key)</CODE> 335 336<BR> 337 Deletes all entities with a given index key.</TD> 338</TR> 339<TR BGCOLOR="white" CLASS="TableRowColor"> 340<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 341<CODE> boolean</CODE></FONT></TD> 342<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#delete(com.sleepycat.db.Transaction, K)">delete</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 343 K key)</CODE> 344 345<BR> 346 Deletes all entities with a given index key.</TD> 347</TR> 348<TR BGCOLOR="white" CLASS="TableRowColor"> 349<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 350<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E></CODE></FONT></TD> 351<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#entities()">entities</A></B>()</CODE> 352 353<BR> 354 Opens a cursor for traversing all entities in this index.</TD> 355</TR> 356<TR BGCOLOR="white" CLASS="TableRowColor"> 357<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 358<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E></CODE></FONT></TD> 359<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#entities(K, boolean, K, boolean)">entities</A></B>(K fromKey, 360 boolean fromInclusive, 361 K toKey, 362 boolean toInclusive)</CODE> 363 364<BR> 365 Opens a cursor for traversing entities in a key range.</TD> 366</TR> 367<TR BGCOLOR="white" CLASS="TableRowColor"> 368<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 369<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E></CODE></FONT></TD> 370<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#entities(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)">entities</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 371 <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config)</CODE> 372 373<BR> 374 Opens a cursor for traversing all entities in this index.</TD> 375</TR> 376<TR BGCOLOR="white" CLASS="TableRowColor"> 377<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 378<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E></CODE></FONT></TD> 379<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#entities(com.sleepycat.db.Transaction, K, boolean, K, boolean, com.sleepycat.db.CursorConfig)">entities</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 380 K fromKey, 381 boolean fromInclusive, 382 K toKey, 383 boolean toInclusive, 384 <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config)</CODE> 385 386<BR> 387 Opens a cursor for traversing entities in a key range.</TD> 388</TR> 389<TR BGCOLOR="white" CLASS="TableRowColor"> 390<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 391<CODE> <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A></CODE></FONT></TD> 392<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#get(PK)">get</A></B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A> key)</CODE> 393 394<BR> 395 Gets an entity via a key of this index.</TD> 396</TR> 397<TR BGCOLOR="white" CLASS="TableRowColor"> 398<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 399<CODE> <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A></CODE></FONT></TD> 400<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#get(com.sleepycat.db.Transaction, PK, com.sleepycat.db.LockMode)">get</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 401 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A> key, 402 <A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> 403 404<BR> 405 Gets an entity via a key of this index.</TD> 406</TR> 407<TR BGCOLOR="white" CLASS="TableRowColor"> 408<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 409<CODE> <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A></CODE></FONT></TD> 410<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getDatabase()">getDatabase</A></B>()</CODE> 411 412<BR> 413 Returns the underlying database for this index.</TD> 414</TR> 415<TR BGCOLOR="white" CLASS="TableRowColor"> 416<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 417<CODE> <A HREF="../../../com/sleepycat/bind/EntityBinding.html" title="interface in com.sleepycat.bind">EntityBinding</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>></CODE></FONT></TD> 418<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getEntityBinding()">getEntityBinding</A></B>()</CODE> 419 420<BR> 421 Returns the entity binding for this index.</TD> 422</TR> 423<TR BGCOLOR="white" CLASS="TableRowColor"> 424<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 425<CODE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>></CODE></FONT></TD> 426<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getEntityClass()">getEntityClass</A></B>()</CODE> 427 428<BR> 429 Returns the entity class for this index.</TD> 430</TR> 431<TR BGCOLOR="white" CLASS="TableRowColor"> 432<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 433<CODE> <A HREF="../../../com/sleepycat/bind/EntryBinding.html" title="interface in com.sleepycat.bind">EntryBinding</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>></CODE></FONT></TD> 434<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getKeyBinding()">getKeyBinding</A></B>()</CODE> 435 436<BR> 437 Returns the primary key binding for this index.</TD> 438</TR> 439<TR BGCOLOR="white" CLASS="TableRowColor"> 440<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 441<CODE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>></CODE></FONT></TD> 442<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getKeyClass()">getKeyClass</A></B>()</CODE> 443 444<BR> 445 Returns the primary key class for this index.</TD> 446</TR> 447<TR BGCOLOR="white" CLASS="TableRowColor"> 448<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 449<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K></CODE></FONT></TD> 450<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#keys()">keys</A></B>()</CODE> 451 452<BR> 453 Opens a cursor for traversing all keys in this index.</TD> 454</TR> 455<TR BGCOLOR="white" CLASS="TableRowColor"> 456<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 457<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K></CODE></FONT></TD> 458<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#keys(K, boolean, K, boolean)">keys</A></B>(K fromKey, 459 boolean fromInclusive, 460 K toKey, 461 boolean toInclusive)</CODE> 462 463<BR> 464 Opens a cursor for traversing keys in a key range.</TD> 465</TR> 466<TR BGCOLOR="white" CLASS="TableRowColor"> 467<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 468<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K></CODE></FONT></TD> 469<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#keys(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)">keys</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 470 <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config)</CODE> 471 472<BR> 473 Opens a cursor for traversing all keys in this index.</TD> 474</TR> 475<TR BGCOLOR="white" CLASS="TableRowColor"> 476<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 477<CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K></CODE></FONT></TD> 478<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#keys(com.sleepycat.db.Transaction, K, boolean, K, boolean, com.sleepycat.db.CursorConfig)">keys</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 479 K fromKey, 480 boolean fromInclusive, 481 K toKey, 482 boolean toInclusive, 483 <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config)</CODE> 484 485<BR> 486 Opens a cursor for traversing keys in a key range.</TD> 487</TR> 488<TR BGCOLOR="white" CLASS="TableRowColor"> 489<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 490<CODE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>,<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>></CODE></FONT></TD> 491<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#map()">map</A></B>()</CODE> 492 493<BR> 494 Returns a standard Java map based on this entity index.</TD> 495</TR> 496<TR BGCOLOR="white" CLASS="TableRowColor"> 497<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 498<CODE> <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A></CODE></FONT></TD> 499<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(E)">put</A></B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity)</CODE> 500 501<BR> 502 Inserts an entity and returns null, or updates it if the primary key 503 already exists and returns the existing entity.</TD> 504</TR> 505<TR BGCOLOR="white" CLASS="TableRowColor"> 506<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 507<CODE> <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A></CODE></FONT></TD> 508<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(com.sleepycat.db.Transaction, E)">put</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 509 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity)</CODE> 510 511<BR> 512 Inserts an entity and returns null, or updates it if the primary key 513 already exists and returns the existing entity.</TD> 514</TR> 515<TR BGCOLOR="white" CLASS="TableRowColor"> 516<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 517<CODE> boolean</CODE></FONT></TD> 518<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoOverwrite(E)">putNoOverwrite</A></B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity)</CODE> 519 520<BR> 521 Inserts an entity and returns true, or returns false if the primary key 522 already exists.</TD> 523</TR> 524<TR BGCOLOR="white" CLASS="TableRowColor"> 525<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 526<CODE> boolean</CODE></FONT></TD> 527<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoOverwrite(com.sleepycat.db.Transaction, E)">putNoOverwrite</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 528 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity)</CODE> 529 530<BR> 531 Inserts an entity and returns true, or returns false if the primary key 532 already exists.</TD> 533</TR> 534<TR BGCOLOR="white" CLASS="TableRowColor"> 535<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 536<CODE> void</CODE></FONT></TD> 537<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoReturn(E)">putNoReturn</A></B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity)</CODE> 538 539<BR> 540 Inserts an entity, or updates it if the primary key already exists (does 541 not return the existing entity).</TD> 542</TR> 543<TR BGCOLOR="white" CLASS="TableRowColor"> 544<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 545<CODE> void</CODE></FONT></TD> 546<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoReturn(com.sleepycat.db.Transaction, E)">putNoReturn</A></B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 547 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity)</CODE> 548 549<BR> 550 Inserts an entity, or updates it if the primary key already exists (does 551 not return the existing entity).</TD> 552</TR> 553<TR BGCOLOR="white" CLASS="TableRowColor"> 554<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 555<CODE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>,<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>></CODE></FONT></TD> 556<TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#sortedMap()">sortedMap</A></B>()</CODE> 557 558<BR> 559 Returns a standard Java sorted map based on this entity index.</TD> 560</TR> 561</TABLE> 562 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 563<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 564<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 565<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> 566</TR> 567<TR BGCOLOR="white" CLASS="TableRowColor"> 568<TD><CODE><A HREF="http://java.sun.com/j2se/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://java.sun.com/j2se/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://java.sun.com/j2se/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://java.sun.com/j2se/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://java.sun.com/j2se/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://java.sun.com/j2se/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://java.sun.com/j2se/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://java.sun.com/j2se/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://java.sun.com/j2se/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://java.sun.com/j2se/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://java.sun.com/j2se/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> 569</TR> 570</TABLE> 571 572<P> 573 574<!-- ========= CONSTRUCTOR DETAIL ======== --> 575 576<A NAME="constructor_detail"><!-- --></A> 577<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 578<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 579<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 580<B>Constructor Detail</B></FONT></TH> 581</TR> 582</TABLE> 583 584<A NAME="PrimaryIndex(com.sleepycat.db.Database, java.lang.Class, com.sleepycat.bind.EntryBinding, java.lang.Class, com.sleepycat.bind.EntityBinding)"><!-- --></A><H3> 585PrimaryIndex</H3> 586<PRE> 587public <B>PrimaryIndex</B>(<A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A> database, 588 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>> keyClass, 589 <A HREF="../../../com/sleepycat/bind/EntryBinding.html" title="interface in com.sleepycat.bind">EntryBinding</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>> keyBinding, 590 <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> entityClass, 591 <A HREF="../../../com/sleepycat/bind/EntityBinding.html" title="interface in com.sleepycat.bind">EntityBinding</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> entityBinding) 592 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 593<DL> 594<DD>Creates a primary index without using an <code>EntityStore</code>. 595 596 <p>This constructor is not normally needed and is provided for 597 applications that wish to use custom bindings along with the Direct 598 Persistence Layer. Normally, <A HREF="../../../com/sleepycat/persist/EntityStore.html#getPrimaryIndex(java.lang.Class, java.lang.Class)"><CODE>getPrimaryIndex</CODE></A> is used instead.</p> 599 600 <p>Note that when this constructor is used directly, primary keys cannot 601 be automatically assigned from a sequence. The key assignment feature 602 requires knowledge of the primary key field, which is only available if 603 an <code>EntityStore</code> is used. Of course, primary keys may be 604 assigned from a sequence manually before calling the <code>put</code> 605 methods in this class.</p> 606<P> 607<DL> 608<DT><B>Parameters:</B><DD><CODE>database</CODE> - the primary database.<DD><CODE>keyClass</CODE> - the class of the primary key.<DD><CODE>keyBinding</CODE> - the binding to be used for primary keys.<DD><CODE>entityClass</CODE> - the class of the entities stored in this index.<DD><CODE>entityBinding</CODE> - the binding to be used for entities. 609<DT><B>Throws:</B> 610<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 611</DL> 612 613<!-- ============ METHOD DETAIL ========== --> 614 615<A NAME="method_detail"><!-- --></A> 616<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 617<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 618<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 619<B>Method Detail</B></FONT></TH> 620</TR> 621</TABLE> 622 623<A NAME="getDatabase()"><!-- --></A><H3> 624getDatabase</H3> 625<PRE> 626public <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A> <B>getDatabase</B>()</PRE> 627<DL> 628<DD>Returns the underlying database for this index. 629<P> 630<DD><DL> 631 632<DT><B>Returns:</B><DD>the database.</DL> 633</DD> 634</DL> 635<HR> 636 637<A NAME="getKeyClass()"><!-- --></A><H3> 638getKeyClass</H3> 639<PRE> 640public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>> <B>getKeyClass</B>()</PRE> 641<DL> 642<DD>Returns the primary key class for this index. 643<P> 644<DD><DL> 645 646<DT><B>Returns:</B><DD>the key class.</DL> 647</DD> 648</DL> 649<HR> 650 651<A NAME="getKeyBinding()"><!-- --></A><H3> 652getKeyBinding</H3> 653<PRE> 654public <A HREF="../../../com/sleepycat/bind/EntryBinding.html" title="interface in com.sleepycat.bind">EntryBinding</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>> <B>getKeyBinding</B>()</PRE> 655<DL> 656<DD>Returns the primary key binding for this index. 657<P> 658<DD><DL> 659 660<DT><B>Returns:</B><DD>the key binding.</DL> 661</DD> 662</DL> 663<HR> 664 665<A NAME="getEntityClass()"><!-- --></A><H3> 666getEntityClass</H3> 667<PRE> 668public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> <B>getEntityClass</B>()</PRE> 669<DL> 670<DD>Returns the entity class for this index. 671<P> 672<DD><DL> 673 674<DT><B>Returns:</B><DD>the entity class.</DL> 675</DD> 676</DL> 677<HR> 678 679<A NAME="getEntityBinding()"><!-- --></A><H3> 680getEntityBinding</H3> 681<PRE> 682public <A HREF="../../../com/sleepycat/bind/EntityBinding.html" title="interface in com.sleepycat.bind">EntityBinding</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> <B>getEntityBinding</B>()</PRE> 683<DL> 684<DD>Returns the entity binding for this index. 685<P> 686<DD><DL> 687 688<DT><B>Returns:</B><DD>the entity binding.</DL> 689</DD> 690</DL> 691<HR> 692 693<A NAME="put(java.lang.Object)"><!-- --></A><A NAME="put(E)"><!-- --></A><H3> 694put</H3> 695<PRE> 696public <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> <B>put</B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) 697 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 698<DL> 699<DD>Inserts an entity and returns null, or updates it if the primary key 700 already exists and returns the existing entity. 701 702 <p>If a <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> is used and the primary key field of 703 the given entity is null or zero, this method will assign the next value 704 from the sequence to the primary key field of the given entity.</p> 705 706 <p>Auto-commit is used implicitly if the store is transactional.</p> 707<P> 708<DD><DL> 709<DT><B>Parameters:</B><DD><CODE>entity</CODE> - the entity to be inserted or updated. 710<DT><B>Returns:</B><DD>the existing entity that was updated, or null if the entity was 711 inserted. 712<DT><B>Throws:</B> 713<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 714</DD> 715</DL> 716<HR> 717 718<A NAME="put(com.sleepycat.db.Transaction,java.lang.Object)"><!-- --></A><A NAME="put(com.sleepycat.db.Transaction, E)"><!-- --></A><H3> 719put</H3> 720<PRE> 721public <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> <B>put</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 722 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) 723 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 724<DL> 725<DD>Inserts an entity and returns null, or updates it if the primary key 726 already exists and returns the existing entity. 727 728 <p>If a <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> is used and the primary key field of 729 the given entity is null or zero, this method will assign the next value 730 from the sequence to the primary key field of the given entity.</p> 731<P> 732<DD><DL> 733<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, null to use 734 auto-commit, or null if the store is non-transactional.<DD><CODE>entity</CODE> - the entity to be inserted or updated. 735<DT><B>Returns:</B><DD>the existing entity that was updated, or null if the entity was 736 inserted. 737<DT><B>Throws:</B> 738<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 739</DD> 740</DL> 741<HR> 742 743<A NAME="putNoReturn(java.lang.Object)"><!-- --></A><A NAME="putNoReturn(E)"><!-- --></A><H3> 744putNoReturn</H3> 745<PRE> 746public void <B>putNoReturn</B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) 747 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 748<DL> 749<DD>Inserts an entity, or updates it if the primary key already exists (does 750 not return the existing entity). This method may be used instead of 751 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(E)"><CODE>put(Object)</CODE></A> to save the overhead of returning the existing 752 entity. 753 754 <p>If a <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> is used and the primary key field of 755 the given entity is null or zero, this method will assign the next value 756 from the sequence to the primary key field of the given entity.</p> 757 758 <p>Auto-commit is used implicitly if the store is transactional.</p> 759<P> 760<DD><DL> 761<DT><B>Parameters:</B><DD><CODE>entity</CODE> - the entity to be inserted or updated. 762<DT><B>Throws:</B> 763<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 764</DD> 765</DL> 766<HR> 767 768<A NAME="putNoReturn(com.sleepycat.db.Transaction,java.lang.Object)"><!-- --></A><A NAME="putNoReturn(com.sleepycat.db.Transaction, E)"><!-- --></A><H3> 769putNoReturn</H3> 770<PRE> 771public void <B>putNoReturn</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 772 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) 773 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 774<DL> 775<DD>Inserts an entity, or updates it if the primary key already exists (does 776 not return the existing entity). This method may be used instead of 777 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(com.sleepycat.db.Transaction, E)"><CODE>put(Transaction,Object)</CODE></A> to save the overhead of returning the 778 existing entity. 779 780 <p>If a <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> is used and the primary key field of 781 the given entity is null or zero, this method will assign the next value 782 from the sequence to the primary key field of the given entity.</p> 783<P> 784<DD><DL> 785<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, null to use 786 auto-commit, or null if the store is non-transactional.<DD><CODE>entity</CODE> - the entity to be inserted or updated. 787<DT><B>Throws:</B> 788<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 789</DD> 790</DL> 791<HR> 792 793<A NAME="putNoOverwrite(java.lang.Object)"><!-- --></A><A NAME="putNoOverwrite(E)"><!-- --></A><H3> 794putNoOverwrite</H3> 795<PRE> 796public boolean <B>putNoOverwrite</B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) 797 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 798<DL> 799<DD>Inserts an entity and returns true, or returns false if the primary key 800 already exists. 801 802 <p>If a <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> is used and the primary key field of 803 the given entity is null or zero, this method will assign the next value 804 from the sequence to the primary key field of the given entity.</p> 805 806 <p>Auto-commit is used implicitly if the store is transactional.</p> 807<P> 808<DD><DL> 809<DT><B>Parameters:</B><DD><CODE>entity</CODE> - the entity to be inserted. 810<DT><B>Returns:</B><DD>true if the entity was inserted, or false if an entity with the 811 same primary key is already present. 812<DT><B>Throws:</B> 813<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 814</DD> 815</DL> 816<HR> 817 818<A NAME="putNoOverwrite(com.sleepycat.db.Transaction,java.lang.Object)"><!-- --></A><A NAME="putNoOverwrite(com.sleepycat.db.Transaction, E)"><!-- --></A><H3> 819putNoOverwrite</H3> 820<PRE> 821public boolean <B>putNoOverwrite</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 822 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) 823 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 824<DL> 825<DD>Inserts an entity and returns true, or returns false if the primary key 826 already exists. 827 828 <p>If a <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> is used and the primary key field of 829 the given entity is null or zero, this method will assign the next value 830 from the sequence to the primary key field of the given entity.</p> 831<P> 832<DD><DL> 833<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, null to use 834 auto-commit, or null if the store is non-transactional.<DD><CODE>entity</CODE> - the entity to be inserted. 835<DT><B>Returns:</B><DD>true if the entity was inserted, or false if an entity with the 836 same primary key is already present. 837<DT><B>Throws:</B> 838<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 839</DD> 840</DL> 841<HR> 842 843<A NAME="get(java.lang.Object)"><!-- --></A><A NAME="get(PK)"><!-- --></A><H3> 844get</H3> 845<PRE> 846public <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> <B>get</B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A> key) 847 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 848<DL> 849<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#get(K)">EntityIndex</A></CODE></B></DD> 850<DD>Gets an entity via a key of this index. 851 852 <p>The operation will not be transaction protected, and <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> 853<P> 854<DD><DL> 855<DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to search for. 856<DT><B>Returns:</B><DD>the value mapped to the given key, or null if the key is not 857 present in the index. 858<DT><B>Throws:</B> 859<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 860</DD> 861</DL> 862<HR> 863 864<A NAME="get(com.sleepycat.db.Transaction,java.lang.Object,com.sleepycat.db.LockMode)"><!-- --></A><A NAME="get(com.sleepycat.db.Transaction, PK, com.sleepycat.db.LockMode)"><!-- --></A><H3> 865get</H3> 866<PRE> 867public <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> <B>get</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 868 <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A> key, 869 <A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) 870 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 871<DL> 872<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#get(com.sleepycat.db.Transaction, K, com.sleepycat.db.LockMode)">EntityIndex</A></CODE></B></DD> 873<DD>Gets an entity via a key of this index. 874<P> 875<DD><DL> 876<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, or null 877 if the operation should not be transaction protected.<DD><CODE>key</CODE> - the key to search for.<DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to 878 use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. 879<DT><B>Returns:</B><DD>the value mapped to the given key, or null if the key is not 880 present in the index. 881<DT><B>Throws:</B> 882<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 883</DD> 884</DL> 885<HR> 886 887<A NAME="map()"><!-- --></A><H3> 888map</H3> 889<PRE> 890public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>,<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> <B>map</B>()</PRE> 891<DL> 892<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#map()">EntityIndex</A></CODE></B></DD> 893<DD>Returns a standard Java map based on this entity index. The <A HREF="../../../com/sleepycat/collections/StoredMap.html" title="class in com.sleepycat.collections"><CODE>StoredMap</CODE></A> returned is defined by the <A HREF="../../../com/sleepycat/collections/package-summary.html">Collections API</A>. Stored collections conform 894 to the standard Java collections framework interface. 895<P> 896<DD><DL> 897 898<DT><B>Returns:</B><DD>the map.</DL> 899</DD> 900</DL> 901<HR> 902 903<A NAME="sortedMap()"><!-- --></A><H3> 904sortedMap</H3> 905<PRE> 906public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</A><<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>,<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> <B>sortedMap</B>()</PRE> 907<DL> 908<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#sortedMap()">EntityIndex</A></CODE></B></DD> 909<DD>Returns a standard Java sorted map based on this entity index. The 910 <A HREF="../../../com/sleepycat/collections/StoredSortedMap.html" title="class in com.sleepycat.collections"><CODE>StoredSortedMap</CODE></A> returned is defined by the <A HREF="../../../com/sleepycat/collections/package-summary.html">Collections API</A>. Stored collections conform 911 to the standard Java collections framework interface. 912<P> 913<DD><DL> 914 915<DT><B>Returns:</B><DD>the map.</DL> 916</DD> 917</DL> 918<HR> 919 920<A NAME="contains(java.lang.Object)"><!-- --></A><A NAME="contains(K)"><!-- --></A><H3> 921contains</H3> 922<PRE> 923public boolean <B>contains</B>(K key) 924 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 925<DL> 926<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#contains(K)">EntityIndex</A></CODE></B></DD> 927<DD>Checks for existence of a key in this index. 928 929 <p>The operation will not be transaction protected, and <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A> is used implicitly.</p> 930<P> 931<DD><DL> 932<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#contains(K)">contains</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 933</DD> 934<DD><DL> 935<DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to search for. 936<DT><B>Returns:</B><DD>whether the key exists in the index. 937<DT><B>Throws:</B> 938<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 939</DD> 940</DL> 941<HR> 942 943<A NAME="contains(com.sleepycat.db.Transaction,java.lang.Object,com.sleepycat.db.LockMode)"><!-- --></A><A NAME="contains(com.sleepycat.db.Transaction, K, com.sleepycat.db.LockMode)"><!-- --></A><H3> 944contains</H3> 945<PRE> 946public boolean <B>contains</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 947 K key, 948 <A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) 949 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 950<DL> 951<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#contains(com.sleepycat.db.Transaction, K, com.sleepycat.db.LockMode)">EntityIndex</A></CODE></B></DD> 952<DD>Checks for existence of a key in this index. 953<P> 954<DD><DL> 955<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#contains(com.sleepycat.db.Transaction, K, com.sleepycat.db.LockMode)">contains</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 956</DD> 957<DD><DL> 958<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, or null 959 if the operation should not be transaction protected.<DD><CODE>key</CODE> - the key to search for.<DD><CODE>lockMode</CODE> - the lock mode to use for this operation, or null to 960 use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. 961<DT><B>Returns:</B><DD>whether the key exists in the index. 962<DT><B>Throws:</B> 963<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 964</DD> 965</DL> 966<HR> 967 968<A NAME="count()"><!-- --></A><H3> 969count</H3> 970<PRE> 971public long <B>count</B>() 972 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 973<DL> 974<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#count()">EntityIndex</A></CODE></B></DD> 975<DD>Returns a non-transactional count of the entities in this index. 976 977 <p>This operation is faster than obtaining a count by scanning the index 978 manually, and will not perturb the current contents of the cache. 979 However, the count is not guaranteed to be accurate if there are 980 concurrent updates.</p> 981<P> 982<DD><DL> 983<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#count()">count</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 984</DD> 985<DD><DL> 986 987<DT><B>Returns:</B><DD>the number of entities in this index. 988<DT><B>Throws:</B> 989<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 990</DD> 991</DL> 992<HR> 993 994<A NAME="delete(java.lang.Object)"><!-- --></A><A NAME="delete(K)"><!-- --></A><H3> 995delete</H3> 996<PRE> 997public boolean <B>delete</B>(K key) 998 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 999<DL> 1000<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#delete(K)">EntityIndex</A></CODE></B></DD> 1001<DD>Deletes all entities with a given index key. 1002 1003 <p>Auto-commit is used implicitly if the store is transactional.</p> 1004<P> 1005<DD><DL> 1006<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#delete(K)">delete</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1007</DD> 1008<DD><DL> 1009<DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to search for. 1010<DT><B>Returns:</B><DD>whether any entities were deleted. 1011<DT><B>Throws:</B> 1012<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1013</DD> 1014</DL> 1015<HR> 1016 1017<A NAME="delete(com.sleepycat.db.Transaction,java.lang.Object)"><!-- --></A><A NAME="delete(com.sleepycat.db.Transaction, K)"><!-- --></A><H3> 1018delete</H3> 1019<PRE> 1020public boolean <B>delete</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 1021 K key) 1022 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 1023<DL> 1024<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#delete(com.sleepycat.db.Transaction, K)">EntityIndex</A></CODE></B></DD> 1025<DD>Deletes all entities with a given index key. 1026<P> 1027<DD><DL> 1028<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#delete(com.sleepycat.db.Transaction, K)">delete</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1029</DD> 1030<DD><DL> 1031<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, null to use 1032 auto-commit, or null if the store is non-transactional.<DD><CODE>key</CODE> - the key to search for. 1033<DT><B>Returns:</B><DD>whether any entities were deleted. 1034<DT><B>Throws:</B> 1035<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1036</DD> 1037</DL> 1038<HR> 1039 1040<A NAME="keys()"><!-- --></A><H3> 1041keys</H3> 1042<PRE> 1043public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K> <B>keys</B>() 1044 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 1045<DL> 1046<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys()">EntityIndex</A></CODE></B></DD> 1047<DD>Opens a cursor for traversing all keys in this index. 1048 1049 <p>The operations performed with the cursor will not be transaction 1050 protected, and <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A> is used implicitly. If the 1051 store is transactional, the cursor may not be used to update or delete 1052 entities.</p> 1053<P> 1054<DD><DL> 1055<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys()">keys</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1056</DD> 1057<DD><DL> 1058 1059<DT><B>Returns:</B><DD>the cursor. 1060<DT><B>Throws:</B> 1061<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1062</DD> 1063</DL> 1064<HR> 1065 1066<A NAME="keys(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"><!-- --></A><H3> 1067keys</H3> 1068<PRE> 1069public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K> <B>keys</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 1070 <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config) 1071 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 1072<DL> 1073<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)">EntityIndex</A></CODE></B></DD> 1074<DD>Opens a cursor for traversing all keys in this index. 1075<P> 1076<DD><DL> 1077<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)">keys</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1078</DD> 1079<DD><DL> 1080<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect all operations performed with 1081 the cursor, or null if the operations should not be transaction 1082 protected. If null is specified and the store is transactional, the 1083 cursor may not be used to update or delete entities.<DD><CODE>config</CODE> - the cursor configuration that determines the default lock 1084 mode used for all cursor operations, or null to implicitly use <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A>. 1085<DT><B>Returns:</B><DD>the cursor. 1086<DT><B>Throws:</B> 1087<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1088</DD> 1089</DL> 1090<HR> 1091 1092<A NAME="entities()"><!-- --></A><H3> 1093entities</H3> 1094<PRE> 1095public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E> <B>entities</B>() 1096 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 1097<DL> 1098<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities()">EntityIndex</A></CODE></B></DD> 1099<DD>Opens a cursor for traversing all entities in this index. 1100 1101 <p>The operations performed with the cursor will not be transaction 1102 protected, and <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A> is used implicitly. If the 1103 store is transactional, the cursor may not be used to update or delete 1104 entities.</p> 1105<P> 1106<DD><DL> 1107<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities()">entities</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1108</DD> 1109<DD><DL> 1110 1111<DT><B>Returns:</B><DD>the cursor. 1112<DT><B>Throws:</B> 1113<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1114</DD> 1115</DL> 1116<HR> 1117 1118<A NAME="entities(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"><!-- --></A><H3> 1119entities</H3> 1120<PRE> 1121public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E> <B>entities</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 1122 <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config) 1123 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 1124<DL> 1125<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)">EntityIndex</A></CODE></B></DD> 1126<DD>Opens a cursor for traversing all entities in this index. 1127<P> 1128<DD><DL> 1129<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)">entities</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1130</DD> 1131<DD><DL> 1132<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect all operations performed with 1133 the cursor, or null if the operations should not be transaction 1134 protected. If null is specified and the store is transactional, the 1135 cursor may not be used to update or delete entities.<DD><CODE>config</CODE> - the cursor configuration that determines the default lock 1136 mode used for all cursor operations, or null to implicitly use <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A>. 1137<DT><B>Returns:</B><DD>the cursor. 1138<DT><B>Throws:</B> 1139<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1140</DD> 1141</DL> 1142<HR> 1143 1144<A NAME="keys(java.lang.Object,boolean,java.lang.Object,boolean)"><!-- --></A><A NAME="keys(K, boolean, K, boolean)"><!-- --></A><H3> 1145keys</H3> 1146<PRE> 1147public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K> <B>keys</B>(K fromKey, 1148 boolean fromInclusive, 1149 K toKey, 1150 boolean toInclusive) 1151 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 1152<DL> 1153<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys(K, boolean, K, boolean)">EntityIndex</A></CODE></B></DD> 1154<DD>Opens a cursor for traversing keys in a key range. 1155 1156 <p>The operations performed with the cursor will not be transaction 1157 protected, and <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A> is used implicitly. If the 1158 store is transactional, the cursor may not be used to update or delete 1159 entities.</p> 1160<P> 1161<DD><DL> 1162<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys(K, boolean, K, boolean)">keys</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1163</DD> 1164<DD><DL> 1165<DT><B>Parameters:</B><DD><CODE>fromKey</CODE> - is the lower bound of the key range, or null if the range 1166 has no lower bound.<DD><CODE>fromInclusive</CODE> - is true if keys greater than or equal to fromKey 1167 should be included in the key range, or false if only keys greater than 1168 fromKey should be included.<DD><CODE>toKey</CODE> - is the upper bound of the key range, or null if the range 1169 has no upper bound.<DD><CODE>toInclusive</CODE> - is true if keys less than or equal to toKey should be 1170 included in the key range, or false if only keys less than toKey should 1171 be included. 1172<DT><B>Returns:</B><DD>the cursor. 1173<DT><B>Throws:</B> 1174<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1175</DD> 1176</DL> 1177<HR> 1178 1179<A NAME="keys(com.sleepycat.db.Transaction,java.lang.Object,boolean,java.lang.Object,boolean,com.sleepycat.db.CursorConfig)"><!-- --></A><A NAME="keys(com.sleepycat.db.Transaction, K, boolean, K, boolean, com.sleepycat.db.CursorConfig)"><!-- --></A><H3> 1180keys</H3> 1181<PRE> 1182public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K> <B>keys</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 1183 K fromKey, 1184 boolean fromInclusive, 1185 K toKey, 1186 boolean toInclusive, 1187 <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config) 1188 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 1189<DL> 1190<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys(com.sleepycat.db.Transaction, K, boolean, K, boolean, com.sleepycat.db.CursorConfig)">EntityIndex</A></CODE></B></DD> 1191<DD>Opens a cursor for traversing keys in a key range. 1192<P> 1193<DD><DL> 1194<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys(com.sleepycat.db.Transaction, K, boolean, K, boolean, com.sleepycat.db.CursorConfig)">keys</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1195</DD> 1196<DD><DL> 1197<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect all operations performed with 1198 the cursor, or null if the operations should not be transaction 1199 protected. If null is specified and the store is transactional, the 1200 cursor may not be used to update or delete entities.<DD><CODE>fromKey</CODE> - is the lower bound of the key range, or null if the range 1201 has no lower bound.<DD><CODE>fromInclusive</CODE> - is true if keys greater than or equal to fromKey 1202 should be included in the key range, or false if only keys greater than 1203 fromKey should be included.<DD><CODE>toKey</CODE> - is the upper bound of the key range, or null if the range 1204 has no upper bound.<DD><CODE>toInclusive</CODE> - is true if keys less than or equal to toKey should be 1205 included in the key range, or false if only keys less than toKey should 1206 be included.<DD><CODE>config</CODE> - the cursor configuration that determines the default lock 1207 mode used for all cursor operations, or null to implicitly use <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A>. 1208<DT><B>Returns:</B><DD>the cursor. 1209<DT><B>Throws:</B> 1210<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1211</DD> 1212</DL> 1213<HR> 1214 1215<A NAME="entities(java.lang.Object,boolean,java.lang.Object,boolean)"><!-- --></A><A NAME="entities(K, boolean, K, boolean)"><!-- --></A><H3> 1216entities</H3> 1217<PRE> 1218public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E> <B>entities</B>(K fromKey, 1219 boolean fromInclusive, 1220 K toKey, 1221 boolean toInclusive) 1222 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 1223<DL> 1224<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities(K, boolean, K, boolean)">EntityIndex</A></CODE></B></DD> 1225<DD>Opens a cursor for traversing entities in a key range. 1226 1227 <p>The operations performed with the cursor will not be transaction 1228 protected, and <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A> is used implicitly. If the 1229 store is transactional, the cursor may not be used to update or delete 1230 entities.</p> 1231<P> 1232<DD><DL> 1233<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities(K, boolean, K, boolean)">entities</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1234</DD> 1235<DD><DL> 1236<DT><B>Parameters:</B><DD><CODE>fromKey</CODE> - is the lower bound of the key range, or null if the range 1237 has no lower bound.<DD><CODE>fromInclusive</CODE> - is true if keys greater than or equal to fromKey 1238 should be included in the key range, or false if only keys greater than 1239 fromKey should be included.<DD><CODE>toKey</CODE> - is the upper bound of the key range, or null if the range 1240 has no upper bound.<DD><CODE>toInclusive</CODE> - is true if keys less than or equal to toKey should be 1241 included in the key range, or false if only keys less than toKey should 1242 be included. 1243<DT><B>Returns:</B><DD>the cursor. 1244<DT><B>Throws:</B> 1245<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1246</DD> 1247</DL> 1248<HR> 1249 1250<A NAME="entities(com.sleepycat.db.Transaction,java.lang.Object,boolean,java.lang.Object,boolean,com.sleepycat.db.CursorConfig)"><!-- --></A><A NAME="entities(com.sleepycat.db.Transaction, K, boolean, K, boolean, com.sleepycat.db.CursorConfig)"><!-- --></A><H3> 1251entities</H3> 1252<PRE> 1253public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E> <B>entities</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, 1254 K fromKey, 1255 boolean fromInclusive, 1256 K toKey, 1257 boolean toInclusive, 1258 <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config) 1259 throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> 1260<DL> 1261<DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities(com.sleepycat.db.Transaction, K, boolean, K, boolean, com.sleepycat.db.CursorConfig)">EntityIndex</A></CODE></B></DD> 1262<DD>Opens a cursor for traversing entities in a key range. 1263<P> 1264<DD><DL> 1265<DT><B>Specified by:</B><DD><CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities(com.sleepycat.db.Transaction, K, boolean, K, boolean, com.sleepycat.db.CursorConfig)">entities</A></CODE> in interface <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html" title="interface in com.sleepycat.persist">EntityIndex</A><K,E></CODE></DL> 1266</DD> 1267<DD><DL> 1268<DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect all operations performed with 1269 the cursor, or null if the operations should not be transaction 1270 protected. If null is specified and the store is transactional, the 1271 cursor may not be used to update or delete entities.<DD><CODE>fromKey</CODE> - is the lower bound of the key range, or null if the range 1272 has no lower bound.<DD><CODE>fromInclusive</CODE> - is true if keys greater than or equal to fromKey 1273 should be included in the key range, or false if only keys greater than 1274 fromKey should be included.<DD><CODE>toKey</CODE> - is the upper bound of the key range, or null if the range 1275 has no upper bound.<DD><CODE>toInclusive</CODE> - is true if keys less than or equal to toKey should be 1276 included in the key range, or false if only keys less than toKey should 1277 be included.<DD><CODE>config</CODE> - the cursor configuration that determines the default lock 1278 mode used for all cursor operations, or null to implicitly use <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A>. 1279<DT><B>Returns:</B><DD>the cursor. 1280<DT><B>Throws:</B> 1281<DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> 1282</DD> 1283</DL> 1284<!-- ========= END OF CLASS DATA ========= --> 1285<HR> 1286 1287 1288<!-- ======= START OF BOTTOM NAVBAR ====== --> 1289<A NAME="navbar_bottom"><!-- --></A> 1290<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 1291<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 1292<TR> 1293<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 1294<A NAME="navbar_bottom_firstrow"><!-- --></A> 1295<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 1296 <TR ALIGN="center" VALIGN="top"> 1297 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 1298 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 1299 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 1300 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PrimaryIndex.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 1301 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 1302 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 1303 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 1304 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 1305 </TR> 1306</TABLE> 1307</TD> 1308<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 1309<b>Berkeley DB</b><br><font size="-1"> version 4.8.30</font></EM> 1310</TD> 1311</TR> 1312 1313<TR> 1314<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 1315 <A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A> 1316 <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><B>NEXT CLASS</B></A></FONT></TD> 1317<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 1318 <A HREF="../../../index.html?com/sleepycat/persist/PrimaryIndex.html" target="_top"><B>FRAMES</B></A> 1319 <A HREF="PrimaryIndex.html" target="_top"><B>NO FRAMES</B></A> 1320 <SCRIPT type="text/javascript"> 1321 <!-- 1322 if(window==top) { 1323 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); 1324 } 1325 //--> 1326</SCRIPT> 1327<NOSCRIPT> 1328 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> 1329</NOSCRIPT> 1330 1331 1332</FONT></TD> 1333</TR> 1334<TR> 1335<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 1336 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 1337<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 1338DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 1339</TR> 1340</TABLE> 1341<A NAME="skip-navbar_bottom"></A> 1342<!-- ======== END OF BOTTOM NAVBAR ======= --> 1343 1344<HR> 1345<font size=1>Copyright (c) 1996-2009 Oracle. All rights reserved.</font> 1346</BODY> 1347</HTML> 1348