<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Thu May 12 21:55:02 GMT 2011 --> <TITLE> PrimaryIndex </TITLE> <META NAME="date" CONTENT="2011-05-12"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="PrimaryIndex"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A> <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?com/sleepycat/persist/PrimaryIndex.html" target="_top"><B>FRAMES</B></A> <A HREF="PrimaryIndex.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.sleepycat.persist</FONT> <BR> Class PrimaryIndex<PK,E></H2> <PRE> java.lang.Object <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.persist.PrimaryIndex<PK,E></B> </PRE> <DL> <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> </DL> <HR> <DL> <DT><PRE>public class <B>PrimaryIndex<PK,E></B><DT>extends java.lang.Object</DL> </PRE> <P> The primary index for an entity class and its primary key. <p><code>PrimaryIndex</code> objects are thread-safe. Multiple threads may safely call the methods of a shared <code>PrimaryIndex</code> object.</p> <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 key type (PK) to the entity type (E).</p> <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 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 shown in the following example.</p> <pre class="code"> @Entity class Employee { @PrimaryKey long id; String name; Employee(long id, String name) { this.id = id; this.name = name; } private Employee() {} // For bindings }</pre> <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 primary key class and the entity class. For example:</p> <pre class="code"> EntityStore store = new EntityStore(...); <code>PrimaryIndex<Long,Employee></code> primaryIndex = store.getPrimaryIndex(Long.class, Employee.class);</pre> </pre> <p>Note that <code>Long.class</code> is passed as the primary key class, but the primary key field has the primitive type <code>long</code>. When a primitive primary key field is used, the corresponding primitive wrapper class is used to access the primary index. For more information on key field types, see <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html" title="annotation in com.sleepycat.persist.model"><CODE>PrimaryKey</CODE></A>.</p> <p>The <code>PrimaryIndex</code> provides the primary storage and access methods for the instances of a particular entity class. Entities are inserted and updated in the <code>PrimaryIndex</code> by calling a method in the family of <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 entity with the same primary key already exists. If an entity with the same primary key does exist, it will update the entity and return the existing (old) entity. For example:</p> <pre class="code"> Employee oldEntity; oldEntity = primaryIndex.put(new Employee(1, "Jane Smith")); // Inserts an entity assert oldEntity == null; oldEntity = primaryIndex.put(new Employee(2, "Joan Smith")); // Inserts an entity assert oldEntity == null; oldEntity = primaryIndex.put(new Employee(2, "Joan M. Smith")); // Updates an entity assert oldEntity != null;</pre> <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 returning the existing entity, when the existing entity is not important to the application. The return type of <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoReturn(E)"><CODE>putNoReturn(E)</CODE></A> is void. For example:</p> <pre class="code"> primaryIndex.putNoReturn(new Employee(1, "Jane Smith")); // Inserts an entity primaryIndex.putNoReturn(new Employee(2, "Joan Smith")); // Inserts an entity primaryIndex.putNoReturn(new Employee(2, "Joan M. Smith")); // Updates an entity</pre> <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 entity is not overwritten. <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#putNoOverwrite(E)"><CODE>putNoOverwrite(E)</CODE></A> returns true if the entity was inserted, or false if an existing entity exists and no action was taken. For example:<p> <pre class="code"> boolean inserted; inserted = primaryIndex.putNoOverwrite(new Employee(1, "Jane Smith")); // Inserts an entity assert inserted; inserted = primaryIndex.putNoOverwrite(new Employee(2, "Joan Smith")); // Inserts an entity assert inserted; inserted = primaryIndex.putNoOverwrite(new Employee(2, "Joan M. Smith")); // <strong>No action was taken!</strong> assert !inserted;</pre> <p>Primary key values must be unique, in other words, each instance of a given entity class must have a distinct primary key value. Rather than assigning the unique primary key values yourself, a <em>sequence</em> can be used to assign sequential integer values automatically, starting with the value 1 (one). A sequence is defined using the <A HREF="../../../com/sleepycat/persist/model/PrimaryKey.html#sequence()"><CODE>PrimaryKey.sequence()</CODE></A> annotation property. For example:</p> <pre class="code"> @Entity class Employee { @PrimaryKey(sequence="ID") long id; String name; Employee(String name) { this.name = name; } private Employee() {} // For bindings }</pre> <p>The name of the sequence used above is "ID". Any name can be used. If the same sequence name is used in more than one entity class, the sequence will be shared by those classes, in other words, a single sequence of 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> <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 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 to the assigned key value. For example:</p> <pre class="code"> Employee employee; employee = new Employee("Jane Smith"); primaryIndex.putNoReturn(employee); // Inserts an entity assert employee.id == 1; employee = new Employee("Joan Smith"); primaryIndex.putNoReturn(employee); // Inserts an entity assert employee.id == 2;</pre> <p>This begs the question: How do you update an existing entity, without 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 will only assign a new key from the sequence if the primary key field is zero or null (for reference types). If an entity with a non-zero and 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 with that primary key value will be updated. For example:</p> <pre class="code"> Employee employee; employee = new Employee("Jane Smith"); primaryIndex.putNoReturn(employee); // Inserts an entity assert employee.id == 1; employee = new Employee("Joan Smith"); primaryIndex.putNoReturn(employee); // Inserts an entity assert employee.id == 2; employee.name = "Joan M. Smith"; primaryIndex.putNoReturn(employee); // Updates an existing entity assert employee.id == 2;</pre> <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, it shares the common index methods for retrieving and deleting entities, 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 information on these topics.</p> <p>Note that when using an index, keys and values are stored and retrieved by value not by reference. In other words, if an entity object is stored and then retrieved, or retrieved twice, each object will be a separate instance. For example, in the code below the assertion will always fail.</p> <pre class="code"> MyKey key = ...; MyEntity entity1 = new MyEntity(key, ...); index.put(entity1); MyEntity entity2 = index.get(key); assert entity1 == entity2; // always fails! </pre> <P> <P> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <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, java.lang.Class<<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>> keyClass, <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, java.lang.Class<<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> entityClass, <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> <BR> Creates a primary index without using an <code>EntityStore</code>.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#contains(K)">contains</A></B>(K key)</CODE> <BR> Checks for existence of a key in this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <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, K key, <A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Checks for existence of a key in this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#count()">count</A></B>()</CODE> <BR> Returns a non-transactional count of the entities in this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#delete(K)">delete</A></B>(K key)</CODE> <BR> Deletes all entities with a given index key.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <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, K key)</CODE> <BR> Deletes all entities with a given index key.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#entities()">entities</A></B>()</CODE> <BR> Opens a cursor for traversing all entities in this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#entities(K, boolean, K, boolean)">entities</A></B>(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)</CODE> <BR> Opens a cursor for traversing entities in a key range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E></CODE></FONT></TD> <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, <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config)</CODE> <BR> Opens a cursor for traversing all entities in this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E></CODE></FONT></TD> <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, K fromKey, boolean fromInclusive, K toKey, boolean toInclusive, <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config)</CODE> <BR> Opens a cursor for traversing entities in a key range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A></CODE></FONT></TD> <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> <BR> Gets an entity via a key of this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A></CODE></FONT></TD> <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, <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A> key, <A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode)</CODE> <BR> Gets an entity via a key of this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getDatabase()">getDatabase</A></B>()</CODE> <BR> Returns the underlying database for this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <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> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getEntityBinding()">getEntityBinding</A></B>()</CODE> <BR> Returns the entity binding for this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Class<<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getEntityClass()">getEntityClass</A></B>()</CODE> <BR> Returns the entity class for this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <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> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getKeyBinding()">getKeyBinding</A></B>()</CODE> <BR> Returns the primary key binding for this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Class<<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#getKeyClass()">getKeyClass</A></B>()</CODE> <BR> Returns the primary key class for this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#keys()">keys</A></B>()</CODE> <BR> Opens a cursor for traversing all keys in this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#keys(K, boolean, K, boolean)">keys</A></B>(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)</CODE> <BR> Opens a cursor for traversing keys in a key range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K></CODE></FONT></TD> <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, <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config)</CODE> <BR> Opens a cursor for traversing all keys in this index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K></CODE></FONT></TD> <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, K fromKey, boolean fromInclusive, K toKey, boolean toInclusive, <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config)</CODE> <BR> Opens a cursor for traversing keys in a key range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Map<<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> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#map()">map</A></B>()</CODE> <BR> Returns a standard Java map based on this entity index.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A></CODE></FONT></TD> <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> <BR> Inserts an entity and returns null, or updates it if the primary key already exists and returns the existing entity.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A></CODE></FONT></TD> <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, <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity)</CODE> <BR> Inserts an entity and returns null, or updates it if the primary key already exists and returns the existing entity.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <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> <BR> Inserts an entity and returns true, or returns false if the primary key already exists.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <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, <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity)</CODE> <BR> Inserts an entity and returns true, or returns false if the primary key already exists.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <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> <BR> Inserts an entity, or updates it if the primary key already exists (does not return the existing entity).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <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, <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity)</CODE> <BR> Inserts an entity, or updates it if the primary key already exists (does not return the existing entity).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.SortedMap<<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> <TD><CODE><B><A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#sortedMap()">sortedMap</A></B>()</CODE> <BR> Returns a standard Java sorted map based on this entity index.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="PrimaryIndex(com.sleepycat.db.Database, java.lang.Class, com.sleepycat.bind.EntryBinding, java.lang.Class, com.sleepycat.bind.EntityBinding)"><!-- --></A><H3> PrimaryIndex</H3> <PRE> public <B>PrimaryIndex</B>(<A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A> database, java.lang.Class<<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>> keyClass, <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, java.lang.Class<<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> entityClass, <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) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Creates a primary index without using an <code>EntityStore</code>. <p>This constructor is not normally needed and is provided for applications that wish to use custom bindings along with the Direct 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> <p>Note that when this constructor is used directly, primary keys cannot be automatically assigned from a sequence. The key assignment feature requires knowledge of the primary key field, which is only available if an <code>EntityStore</code> is used. Of course, primary keys may be assigned from a sequence manually before calling the <code>put</code> methods in this class.</p> <P> <DL> <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. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getDatabase()"><!-- --></A><H3> getDatabase</H3> <PRE> public <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db">Database</A> <B>getDatabase</B>()</PRE> <DL> <DD>Returns the underlying database for this index. <P> <DD><DL> <DT><B>Returns:</B><DD>the database.</DL> </DD> </DL> <HR> <A NAME="getKeyClass()"><!-- --></A><H3> getKeyClass</H3> <PRE> public java.lang.Class<<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A>> <B>getKeyClass</B>()</PRE> <DL> <DD>Returns the primary key class for this index. <P> <DD><DL> <DT><B>Returns:</B><DD>the key class.</DL> </DD> </DL> <HR> <A NAME="getKeyBinding()"><!-- --></A><H3> getKeyBinding</H3> <PRE> public <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> <DL> <DD>Returns the primary key binding for this index. <P> <DD><DL> <DT><B>Returns:</B><DD>the key binding.</DL> </DD> </DL> <HR> <A NAME="getEntityClass()"><!-- --></A><H3> getEntityClass</H3> <PRE> public java.lang.Class<<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A>> <B>getEntityClass</B>()</PRE> <DL> <DD>Returns the entity class for this index. <P> <DD><DL> <DT><B>Returns:</B><DD>the entity class.</DL> </DD> </DL> <HR> <A NAME="getEntityBinding()"><!-- --></A><H3> getEntityBinding</H3> <PRE> public <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> <DL> <DD>Returns the entity binding for this index. <P> <DD><DL> <DT><B>Returns:</B><DD>the entity binding.</DL> </DD> </DL> <HR> <A NAME="put(java.lang.Object)"><!-- --></A><A NAME="put(E)"><!-- --></A><H3> put</H3> <PRE> public <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) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Inserts an entity and returns null, or updates it if the primary key already exists and returns the existing entity. <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 the given entity is null or zero, this method will assign the next value from the sequence to the primary key field of the given entity.</p> <p>Auto-commit is used implicitly if the store is transactional.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>entity</CODE> - the entity to be inserted or updated. <DT><B>Returns:</B><DD>the existing entity that was updated, or null if the entity was inserted. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="put(com.sleepycat.db.Transaction,java.lang.Object)"><!-- --></A><A NAME="put(com.sleepycat.db.Transaction, E)"><!-- --></A><H3> put</H3> <PRE> public <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, <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Inserts an entity and returns null, or updates it if the primary key already exists and returns the existing entity. <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 the given entity is null or zero, this method will assign the next value from the sequence to the primary key field of the given entity.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, null to use auto-commit, or null if the store is non-transactional.<DD><CODE>entity</CODE> - the entity to be inserted or updated. <DT><B>Returns:</B><DD>the existing entity that was updated, or null if the entity was inserted. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="putNoReturn(java.lang.Object)"><!-- --></A><A NAME="putNoReturn(E)"><!-- --></A><H3> putNoReturn</H3> <PRE> public void <B>putNoReturn</B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Inserts an entity, or updates it if the primary key already exists (does not return the existing entity). This method may be used instead of <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html#put(E)"><CODE>put(Object)</CODE></A> to save the overhead of returning the existing entity. <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 the given entity is null or zero, this method will assign the next value from the sequence to the primary key field of the given entity.</p> <p>Auto-commit is used implicitly if the store is transactional.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>entity</CODE> - the entity to be inserted or updated. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="putNoReturn(com.sleepycat.db.Transaction,java.lang.Object)"><!-- --></A><A NAME="putNoReturn(com.sleepycat.db.Transaction, E)"><!-- --></A><H3> putNoReturn</H3> <PRE> public void <B>putNoReturn</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Inserts an entity, or updates it if the primary key already exists (does not return the existing entity). This method may be used instead of <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 existing entity. <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 the given entity is null or zero, this method will assign the next value from the sequence to the primary key field of the given entity.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, null to use auto-commit, or null if the store is non-transactional.<DD><CODE>entity</CODE> - the entity to be inserted or updated. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="putNoOverwrite(java.lang.Object)"><!-- --></A><A NAME="putNoOverwrite(E)"><!-- --></A><H3> putNoOverwrite</H3> <PRE> public boolean <B>putNoOverwrite</B>(<A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Inserts an entity and returns true, or returns false if the primary key already exists. <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 the given entity is null or zero, this method will assign the next value from the sequence to the primary key field of the given entity.</p> <p>Auto-commit is used implicitly if the store is transactional.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>entity</CODE> - the entity to be inserted. <DT><B>Returns:</B><DD>true if the entity was inserted, or false if an entity with the same primary key is already present. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="putNoOverwrite(com.sleepycat.db.Transaction,java.lang.Object)"><!-- --></A><A NAME="putNoOverwrite(com.sleepycat.db.Transaction, E)"><!-- --></A><H3> putNoOverwrite</H3> <PRE> public boolean <B>putNoOverwrite</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">E</A> entity) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD>Inserts an entity and returns true, or returns false if the primary key already exists. <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 the given entity is null or zero, this method will assign the next value from the sequence to the primary key field of the given entity.</p> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, null to use auto-commit, or null if the store is non-transactional.<DD><CODE>entity</CODE> - the entity to be inserted. <DT><B>Returns:</B><DD>true if the entity was inserted, or false if an entity with the same primary key is already present. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="get(java.lang.Object)"><!-- --></A><A NAME="get(PK)"><!-- --></A><H3> get</H3> <PRE> public <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) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#get(K)">EntityIndex</A></CODE></B></DD> <DD>Gets an entity via a key of this index. <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> <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to search for. <DT><B>Returns:</B><DD>the value mapped to the given key, or null if the key is not present in the index. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <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> get</H3> <PRE> public <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, <A HREF="../../../com/sleepycat/persist/PrimaryIndex.html" title="type parameter in PrimaryIndex">PK</A> key, <A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <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> <DD>Gets an entity via a key of this index. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, or null 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 use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the value mapped to the given key, or null if the key is not present in the index. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="map()"><!-- --></A><H3> map</H3> <PRE> public java.util.Map<<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> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#map()">EntityIndex</A></CODE></B></DD> <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 Collections API. Stored collections conform to the standard Java collections framework interface. <P> <DD><DL> <DT><B>Returns:</B><DD>the map.</DL> </DD> </DL> <HR> <A NAME="sortedMap()"><!-- --></A><H3> sortedMap</H3> <PRE> public java.util.SortedMap<<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> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#sortedMap()">EntityIndex</A></CODE></B></DD> <DD>Returns a standard Java sorted map based on this entity index. The <A HREF="../../../com/sleepycat/collections/StoredSortedMap.html" title="class in com.sleepycat.collections"><CODE>StoredSortedMap</CODE></A> returned is defined by the Collections API. Stored collections conform to the standard Java collections framework interface. <P> <DD><DL> <DT><B>Returns:</B><DD>the map.</DL> </DD> </DL> <HR> <A NAME="contains(java.lang.Object)"><!-- --></A><A NAME="contains(K)"><!-- --></A><H3> contains</H3> <PRE> public boolean <B>contains</B>(K key) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#contains(K)">EntityIndex</A></CODE></B></DD> <DD>Checks for existence of a key in this index. <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> <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to search for. <DT><B>Returns:</B><DD>whether the key exists in the index. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <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> contains</H3> <PRE> public boolean <B>contains</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, K key, <A HREF="../../../com/sleepycat/db/LockMode.html" title="class in com.sleepycat.db">LockMode</A> lockMode) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <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> <DD>Checks for existence of a key in this index. <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, or null 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 use <A HREF="../../../com/sleepycat/db/LockMode.html#DEFAULT"><CODE>LockMode.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>whether the key exists in the index. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="count()"><!-- --></A><H3> count</H3> <PRE> public long <B>count</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#count()">EntityIndex</A></CODE></B></DD> <DD>Returns a non-transactional count of the entities in this index. <p>This operation is faster than obtaining a count by scanning the index manually, and will not perturb the current contents of the cache. However, the count is not guaranteed to be accurate if there are concurrent updates.</p> <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Returns:</B><DD>the number of entities in this index. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="delete(java.lang.Object)"><!-- --></A><A NAME="delete(K)"><!-- --></A><H3> delete</H3> <PRE> public boolean <B>delete</B>(K key) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#delete(K)">EntityIndex</A></CODE></B></DD> <DD>Deletes all entities with a given index key. <p>Auto-commit is used implicitly if the store is transactional.</p> <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key to search for. <DT><B>Returns:</B><DD>whether any entities were deleted. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="delete(com.sleepycat.db.Transaction,java.lang.Object)"><!-- --></A><A NAME="delete(com.sleepycat.db.Transaction, K)"><!-- --></A><H3> delete</H3> <PRE> public boolean <B>delete</B>(<A HREF="../../../com/sleepycat/db/Transaction.html" title="class in com.sleepycat.db">Transaction</A> txn, K key) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <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> <DD>Deletes all entities with a given index key. <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect this operation, null to use auto-commit, or null if the store is non-transactional.<DD><CODE>key</CODE> - the key to search for. <DT><B>Returns:</B><DD>whether any entities were deleted. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="keys()"><!-- --></A><H3> keys</H3> <PRE> public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K> <B>keys</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys()">EntityIndex</A></CODE></B></DD> <DD>Opens a cursor for traversing all keys in this index. <p>The operations performed with the cursor will not be transaction protected, and <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A> is used implicitly. If the store is transactional, the cursor may not be used to update or delete entities.</p> <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Returns:</B><DD>the cursor. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="keys(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"><!-- --></A><H3> keys</H3> <PRE> public <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, <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <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> <DD>Opens a cursor for traversing all keys in this index. <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect all operations performed with the cursor, or null if the operations should not be transaction protected. If null is specified and the store is transactional, the cursor may not be used to update or delete entities.<DD><CODE>config</CODE> - the cursor configuration that determines the default lock mode used for all cursor operations, or null to implicitly use <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the cursor. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="entities()"><!-- --></A><H3> entities</H3> <PRE> public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E> <B>entities</B>() throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities()">EntityIndex</A></CODE></B></DD> <DD>Opens a cursor for traversing all entities in this index. <p>The operations performed with the cursor will not be transaction protected, and <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A> is used implicitly. If the store is transactional, the cursor may not be used to update or delete entities.</p> <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Returns:</B><DD>the cursor. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="entities(com.sleepycat.db.Transaction, com.sleepycat.db.CursorConfig)"><!-- --></A><H3> entities</H3> <PRE> public <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, <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <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> <DD>Opens a cursor for traversing all entities in this index. <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect all operations performed with the cursor, or null if the operations should not be transaction protected. If null is specified and the store is transactional, the cursor may not be used to update or delete entities.<DD><CODE>config</CODE> - the cursor configuration that determines the default lock mode used for all cursor operations, or null to implicitly use <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the cursor. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="keys(java.lang.Object,boolean,java.lang.Object,boolean)"><!-- --></A><A NAME="keys(K, boolean, K, boolean)"><!-- --></A><H3> keys</H3> <PRE> public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><K> <B>keys</B>(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#keys(K, boolean, K, boolean)">EntityIndex</A></CODE></B></DD> <DD>Opens a cursor for traversing keys in a key range. <p>The operations performed with the cursor will not be transaction protected, and <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A> is used implicitly. If the store is transactional, the cursor may not be used to update or delete entities.</p> <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>fromKey</CODE> - is the lower bound of the key range, or null if the range has no lower bound.<DD><CODE>fromInclusive</CODE> - is true if keys greater than or equal to fromKey should be included in the key range, or false if only keys greater than fromKey should be included.<DD><CODE>toKey</CODE> - is the upper bound of the key range, or null if the range has no upper bound.<DD><CODE>toInclusive</CODE> - is true if keys less than or equal to toKey should be included in the key range, or false if only keys less than toKey should be included. <DT><B>Returns:</B><DD>the cursor. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <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> keys</H3> <PRE> public <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, K fromKey, boolean fromInclusive, K toKey, boolean toInclusive, <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <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> <DD>Opens a cursor for traversing keys in a key range. <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect all operations performed with the cursor, or null if the operations should not be transaction protected. If null is specified and the store is transactional, the 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 has no lower bound.<DD><CODE>fromInclusive</CODE> - is true if keys greater than or equal to fromKey should be included in the key range, or false if only keys greater than fromKey should be included.<DD><CODE>toKey</CODE> - is the upper bound of the key range, or null if the range has no upper bound.<DD><CODE>toInclusive</CODE> - is true if keys less than or equal to toKey should be included in the key range, or false if only keys less than toKey should be included.<DD><CODE>config</CODE> - the cursor configuration that determines the default lock mode used for all cursor operations, or null to implicitly use <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the cursor. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <A NAME="entities(java.lang.Object,boolean,java.lang.Object,boolean)"><!-- --></A><A NAME="entities(K, boolean, K, boolean)"><!-- --></A><H3> entities</H3> <PRE> public <A HREF="../../../com/sleepycat/persist/EntityCursor.html" title="interface in com.sleepycat.persist">EntityCursor</A><E> <B>entities</B>(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <DD><B>Description copied from interface: <CODE><A HREF="../../../com/sleepycat/persist/EntityIndex.html#entities(K, boolean, K, boolean)">EntityIndex</A></CODE></B></DD> <DD>Opens a cursor for traversing entities in a key range. <p>The operations performed with the cursor will not be transaction protected, and <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A> is used implicitly. If the store is transactional, the cursor may not be used to update or delete entities.</p> <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>fromKey</CODE> - is the lower bound of the key range, or null if the range has no lower bound.<DD><CODE>fromInclusive</CODE> - is true if keys greater than or equal to fromKey should be included in the key range, or false if only keys greater than fromKey should be included.<DD><CODE>toKey</CODE> - is the upper bound of the key range, or null if the range has no upper bound.<DD><CODE>toInclusive</CODE> - is true if keys less than or equal to toKey should be included in the key range, or false if only keys less than toKey should be included. <DT><B>Returns:</B><DD>the cursor. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <HR> <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> entities</H3> <PRE> public <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, K fromKey, boolean fromInclusive, K toKey, boolean toInclusive, <A HREF="../../../com/sleepycat/db/CursorConfig.html" title="class in com.sleepycat.db">CursorConfig</A> config) throws <A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></PRE> <DL> <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> <DD>Opens a cursor for traversing entities in a key range. <P> <DD><DL> <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> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>txn</CODE> - the transaction used to protect all operations performed with the cursor, or null if the operations should not be transaction protected. If null is specified and the store is transactional, the 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 has no lower bound.<DD><CODE>fromInclusive</CODE> - is true if keys greater than or equal to fromKey should be included in the key range, or false if only keys greater than fromKey should be included.<DD><CODE>toKey</CODE> - is the upper bound of the key range, or null if the range has no upper bound.<DD><CODE>toInclusive</CODE> - is true if keys less than or equal to toKey should be included in the key range, or false if only keys less than toKey should be included.<DD><CODE>config</CODE> - the cursor configuration that determines the default lock mode used for all cursor operations, or null to implicitly use <A HREF="../../../com/sleepycat/db/CursorConfig.html#DEFAULT"><CODE>CursorConfig.DEFAULT</CODE></A>. <DT><B>Returns:</B><DD>the cursor. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db">DatabaseException</A></CODE></DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../com/sleepycat/persist/ForwardCursor.html" title="interface in com.sleepycat.persist"><B>PREV CLASS</B></A> <A HREF="../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?com/sleepycat/persist/PrimaryIndex.html" target="_top"><B>FRAMES</B></A> <A HREF="PrimaryIndex.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>