1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>Part I. Programming with the Direct Persistence Layer</title> 7 <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Getting Started with Berkeley DB" /> 10 <link rel="up" href="index.html" title="Getting Started with Berkeley DB" /> 11 <link rel="prev" href="EnvProps.html" title="Environment Properties" /> 12 <link rel="next" href="persist_first.html" title="Chapter 3. Direct Persistence Layer First Steps" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Part I. Programming with the Direct Persistence Layer</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="EnvProps.html">Prev</a> </td> 22 <th width="60%" align="center"> </th> 23 <td width="20%" align="right"> <a accesskey="n" href="persist_first.html">Next</a></td> 24 </tr> 25 </table> 26 <hr /> 27 </div> 28 <div class="part" lang="en" xml:lang="en"> 29 <div class="titlepage"> 30 <div> 31 <div> 32 <h1 class="title"><a id="dpl"></a>Part I. Programming with the Direct Persistence Layer</h1> 33 </div> 34 </div> 35 </div> 36 <div class="partintro" lang="en" xml:lang="en"> 37 <div></div> 38 <p> 39 This section discusses how to build an 40 application using the DPL. The DPL is ideally 41 suited for those applications that want a 42 mechanism for storing and managing Java class 43 objects in a DB database. Note that the DPL 44 is best suited for applications that work with 45 classes with a relatively static schema. 46 </p> 47 <p> 48 Also, the DPL requires Java 1.5. 49 </p> 50 <p> 51 If you want to use Java 1.4 for your DB 52 application, or if you are porting an application 53 from the Berkeley DB API, then you probably want 54 to use the base API instead of the DPL. For 55 information on using the base API, see 56 <a class="xref" href="baseapi.html" title="Part II. Programming with the Base API">Programming with the Base API</a>. 57 </p> 58 <div class="toc"> 59 <p> 60 <b>Table of Contents</b> 61 </p> 62 <dl> 63 <dt> 64 <span class="chapter"> 65 <a href="persist_first.html">3. Direct Persistence Layer First Steps</a> 66 </span> 67 </dt> 68 <dd> 69 <dl> 70 <dt> 71 <span class="sect1"> 72 <a href="persist_first.html#entitystore">Entity Stores</a> 73 </span> 74 </dt> 75 <dd> 76 <dl> 77 <dt> 78 <span class="sect2"> 79 <a href="persist_first.html#persist-open">Opening and Closing Environments and Stores</a> 80 </span> 81 </dt> 82 </dl> 83 </dd> 84 <dt> 85 <span class="sect1"> 86 <a href="persistobject.html">Persistent Objects</a> 87 </span> 88 </dt> 89 <dt> 90 <span class="sect1"> 91 <a href="saveret.html">Saving a Retrieving Data</a> 92 </span> 93 </dt> 94 </dl> 95 </dd> 96 <dt> 97 <span class="chapter"> 98 <a href="persist_index.html">4. Working with Indices</a> 99 </span> 100 </dt> 101 <dd> 102 <dl> 103 <dt> 104 <span class="sect1"> 105 <a href="persist_index.html#dplindexaccess">Accessing Indexes</a> 106 </span> 107 </dt> 108 <dd> 109 <dl> 110 <dt> 111 <span class="sect2"> 112 <a href="persist_index.html#primaryindexaccess">Accessing Primary Indices</a> 113 </span> 114 </dt> 115 <dt> 116 <span class="sect2"> 117 <a href="persist_index.html#secondaryindexaccess">Accessing Secondary Indices</a> 118 </span> 119 </dt> 120 </dl> 121 </dd> 122 <dt> 123 <span class="sect1"> 124 <a href="dplindexcreate.html">Creating Indexes</a> 125 </span> 126 </dt> 127 <dd> 128 <dl> 129 <dt> 130 <span class="sect2"> 131 <a href="dplindexcreate.html#dplprimaryidxdecl">Declaring a Primary Indexes</a> 132 </span> 133 </dt> 134 <dt> 135 <span class="sect2"> 136 <a href="dplindexcreate.html#dplsecondaryidxdecl">Declaring Secondary Indexes</a> 137 </span> 138 </dt> 139 <dt> 140 <span class="sect2"> 141 <a href="dplindexcreate.html#foreignkey">Foreign Key Constraints</a> 142 </span> 143 </dt> 144 </dl> 145 </dd> 146 </dl> 147 </dd> 148 <dt> 149 <span class="chapter"> 150 <a href="persist_access.html">5. Saving and Retrieving Objects</a> 151 </span> 152 </dt> 153 <dd> 154 <dl> 155 <dt> 156 <span class="sect1"> 157 <a href="persist_access.html#simpleentity">A Simple Entity Class</a> 158 </span> 159 </dt> 160 <dt> 161 <span class="sect1"> 162 <a href="simpleda.html">SimpleDA.class</a> 163 </span> 164 </dt> 165 <dt> 166 <span class="sect1"> 167 <a href="simpleput.html">Placing Objects in an Entity Store</a> 168 </span> 169 </dt> 170 <dt> 171 <span class="sect1"> 172 <a href="simpleget.html">Retrieving Objects from an Entity Store</a> 173 </span> 174 </dt> 175 <dt> 176 <span class="sect1"> 177 <a href="getmultiple.html">Retrieving Multiple Objects</a> 178 </span> 179 </dt> 180 <dd> 181 <dl> 182 <dt> 183 <span class="sect2"> 184 <a href="getmultiple.html#dpl_cursor_initialize">Cursor Initialization</a> 185 </span> 186 </dt> 187 <dt> 188 <span class="sect2"> 189 <a href="getmultiple.html#dpl_dups">Working with Duplicate Keys</a> 190 </span> 191 </dt> 192 <dt> 193 <span class="sect2"> 194 <a href="getmultiple.html#dpl_cursor_range">Key Ranges</a> 195 </span> 196 </dt> 197 </dl> 198 </dd> 199 <dt> 200 <span class="sect1"> 201 <a href="dpl_entityjoin.html">Join Cursors</a> 202 </span> 203 </dt> 204 <dt> 205 <span class="sect1"> 206 <a href="dpl_delete.html">Deleting Entity Objects</a> 207 </span> 208 </dt> 209 <dt> 210 <span class="sect1"> 211 <a href="dpl_replace.html">Replacing Entity Objects</a> 212 </span> 213 </dt> 214 </dl> 215 </dd> 216 <dt> 217 <span class="chapter"> 218 <a href="dpl_example.html">6. A DPL Example</a> 219 </span> 220 </dt> 221 <dd> 222 <dl> 223 <dt> 224 <span class="sect1"> 225 <a href="dpl_example.html#vendorclass">Vendor.java</a> 226 </span> 227 </dt> 228 <dt> 229 <span class="sect1"> 230 <a href="inventoryclass.html">Inventory.java</a> 231 </span> 232 </dt> 233 <dt> 234 <span class="sect1"> 235 <a href="mydbenv-persist.html">MyDbEnv</a> 236 </span> 237 </dt> 238 <dt> 239 <span class="sect1"> 240 <a href="dataaccessorclass.html">DataAccessor.java</a> 241 </span> 242 </dt> 243 <dt> 244 <span class="sect1"> 245 <a href="dpl_exampledatabaseput.html">ExampleDatabasePut.java</a> 246 </span> 247 </dt> 248 <dt> 249 <span class="sect1"> 250 <a href="dpl_exampleinventoryread.html">ExampleInventoryRead.java</a> 251 </span> 252 </dt> 253 </dl> 254 </dd> 255 </dl> 256 </div> 257 </div> 258 </div> 259 <div class="navfooter"> 260 <hr /> 261 <table width="100%" summary="Navigation footer"> 262 <tr> 263 <td width="40%" align="left"><a accesskey="p" href="EnvProps.html">Prev</a> </td> 264 <td width="20%" align="center"> </td> 265 <td width="40%" align="right"> <a accesskey="n" href="persist_first.html">Next</a></td> 266 </tr> 267 <tr> 268 <td width="40%" align="left" valign="top">Environment Properties </td> 269 <td width="20%" align="center"> 270 <a accesskey="h" href="index.html">Home</a> 271 </td> 272 <td width="40%" align="right" valign="top"> Chapter 3. Direct Persistence Layer First Steps</td> 273 </tr> 274 </table> 275 </div> 276 </body> 277</html> 278