| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
|
| 3 |
<HTML> |
| 4 |
<HEAD> |
| 5 |
|
| 6 |
<TITLE> |
| 7 |
Entity (Oracle - Berkeley DB Java API) |
| 8 |
</TITLE> |
| 9 |
|
| 10 |
<META NAME="date" CONTENT="2013-09-09"> |
| 11 |
|
| 12 |
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../style.css" TITLE="Style"> |
| 13 |
|
| 14 |
<SCRIPT type="text/javascript"> |
| 15 |
function windowTitle() |
| 16 |
{ |
| 17 |
if (location.href.indexOf('is-external=true') == -1) { |
| 18 |
parent.document.title="Entity (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 |
|
| 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/Entity.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 5.3.28</font></EM> |
| 53 |
</TD> |
| 54 |
</TR> |
| 55 |
|
| 56 |
<TR> |
| 57 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 58 |
<A HREF="../../../../com/sleepycat/persist/model/DeleteAction.html" title="enum in com.sleepycat.persist.model"><B>PREV CLASS</B></A> |
| 59 |
<A HREF="../../../../com/sleepycat/persist/model/EntityMetadata.html" title="class in com.sleepycat.persist.model"><B>NEXT CLASS</B></A></FONT></TD> |
| 60 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 61 |
<A HREF="../../../../index.html?com/sleepycat/persist/model/Entity.html" target="_top"><B>FRAMES</B></A> |
| 62 |
<A HREF="Entity.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: REQUIRED | <A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD> |
| 80 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 81 |
DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD> |
| 82 |
</TR> |
| 83 |
</TABLE> |
| 84 |
<A NAME="skip-navbar_top"></A> |
| 85 |
|
| 86 |
|
| 87 |
<HR> |
| 88 |
|
| 89 |
<H2> |
| 90 |
<FONT SIZE="-1"> |
| 91 |
com.sleepycat.persist.model</FONT> |
| 92 |
<BR> |
| 93 |
Annotation Type Entity</H2> |
| 94 |
<HR> |
| 95 |
<DL> |
| 96 |
<DT><PRE><FONT SIZE="-1"><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Documented.html?is-external=true" title="class or interface in java.lang.annotation">@Documented</A> |
| 97 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</A>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Retention.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</A>=<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation">RUNTIME</A>) |
| 98 |
<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</A>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/Target.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</A>=<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/annotation/ElementType.html?is-external=true#TYPE" title="class or interface in java.lang.annotation">TYPE</A>) |
| 99 |
</FONT>public @interface <B>Entity</B></DL> |
| 100 |
</PRE> |
| 101 |
|
| 102 |
<P> |
| 103 |
Indicates a persistent entity class. For each entity class, a <A HREF="../../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><CODE>PrimaryIndex</CODE></A> can be used to store and access instances of that class. |
| 104 |
Optionally, one or more <A HREF="../../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><CODE>SecondaryIndex</CODE></A> objects may be used to access |
| 105 |
entity instances by secondary key. |
| 106 |
|
| 107 |
<p><strong>Entity Subclasses and Superclasses</strong></p> |
| 108 |
|
| 109 |
<p>An entity class may have any number of subclasses and superclasses; |
| 110 |
however, none of these may themselves be entity classes (annotated with |
| 111 |
<code>Entity</code>).</p> |
| 112 |
|
| 113 |
<p>Entity superclasses (which must be annotated with <code>Persistent</code>, not |
| 114 |
<code>Entity</code>) are used to share common definitions among entity classes. |
| 115 |
Fields in an entity superclass may be defined as primary or secondary keys. |
| 116 |
For example, the following <code>BaseClass</code> defines the primary key for any |
| 117 |
number of entity classes, using a single sequence to assign primary key |
| 118 |
values that will be unique across all entity classes that use it. The |
| 119 |
entity class <code>Pet</code> extends the base class, implicitly defining a |
| 120 |
primary index</p> |
| 121 |
|
| 122 |
<pre class="code"> |
| 123 |
@Persistent |
| 124 |
class BaseClass { |
| 125 |
@PrimaryKey(sequence="ID") |
| 126 |
long id; |
| 127 |
} |
| 128 |
|
| 129 |
@Entity |
| 130 |
class Pet extends BaseClass { |
| 131 |
@SecondaryKey(relate=ONE_TO_ONE) |
| 132 |
String name; |
| 133 |
float height; |
| 134 |
float weight; |
| 135 |
}</pre> |
| 136 |
|
| 137 |
<p>Entity subclasses (which must be annotated with <code>Persistent</code>, not |
| 138 |
<code>Entity</code>) are used to provide polymorphism within a single <code>PrimaryIndex</code>. Instances of the entity class and its subclasses are stored |
| 139 |
in the same <code>PrimaryIndex</code>. For example, the entity class <code>Pet</code> |
| 140 |
defines a primary index that will contain instances of it and its |
| 141 |
subclasses, including <code>Cat</code> which is defined below.</p> |
| 142 |
|
| 143 |
<p>Fields in an entity subclass may be defined as secondary keys, and such |
| 144 |
secondary keys can only be used to query instances of the subclass. For |
| 145 |
example, although the primary key (<code>id</code>) and secondary key (<code>name</code>) can be used to retrieve any <code>Pet</code> instance, the entity subclass |
| 146 |
<code>Cat</code> defines a secondary key (<code>finickyness</code>) that only applies |
| 147 |
to <code>Cat</code> instances. Querying by this key will never retrieve a <code>Dog</code> instance, if such a subclass existed, because a <code>Dog</code> instance |
| 148 |
will never contain a <code>finickyness</code> key.</p> |
| 149 |
|
| 150 |
<pre class="code"> |
| 151 |
@Persistent |
| 152 |
class Cat extends Pet { |
| 153 |
@SecondaryKey(relate=MANY_TO_ONE) |
| 154 |
int finickyness; |
| 155 |
}</pre> |
| 156 |
|
| 157 |
<p><em>WARNING:</em> Entity subclasses that define secondary keys must be |
| 158 |
registered prior to storing an instance of the class. This can be done in |
| 159 |
two ways:</p> |
| 160 |
<ol> |
| 161 |
<li>The <A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#registerClass(java.lang.Class)"><CODE>registerClass</CODE></A> method may be called |
| 162 |
to register the subclass before opening the entity store.</li> |
| 163 |
<li>The <A HREF="../../../../com/sleepycat/persist/EntityStore.html#getSubclassIndex(com.sleepycat.persist.PrimaryIndex, java.lang.Class, java.lang.Class, java.lang.String)"><CODE>getSubclassIndex</CODE></A> method may be |
| 164 |
called to implicitly register the subclass after opening the entity |
| 165 |
store.</li> |
| 166 |
</ol> |
| 167 |
|
| 168 |
<p><strong>Persistent Fields and Types</strong></p> |
| 169 |
|
| 170 |
<p>All non-transient instance fields of an entity class, as well as its |
| 171 |
superclasses and subclasses, are persistent. <code>static</code> and <code>transient</code> fields are not persistent. The persistent fields of a class may |
| 172 |
be <code>private</code>, package-private (default access), <code>protected</code> or |
| 173 |
<code>public</code>.</p> |
| 174 |
|
| 175 |
<p>It is worthwhile to note the reasons that object persistence is defined |
| 176 |
in terms of fields rather than properties (getters and setters). This |
| 177 |
allows business methods (getters and setters) to be defined independently of |
| 178 |
the persistent state of an object; for example, a setter method may perform |
| 179 |
validation that could not be performed if it were called during object |
| 180 |
deserialization. Similarly, this allows public methods to evolve somewhat |
| 181 |
independently of the (typically non-public) persistent fields.</p> |
| 182 |
|
| 183 |
<p><a name="simpleTypes"><strong>Simple Types</strong></a></p> |
| 184 |
|
| 185 |
<p>Persistent types are divided into simple types, enum types, complex |
| 186 |
types, and array types. Simple types and enum types are single valued, |
| 187 |
while array types may contain multiple elements and complex types may |
| 188 |
contain one or more named fields.</p> |
| 189 |
|
| 190 |
<p>Simple types include:</p> |
| 191 |
<ul> |
| 192 |
<li>Java primitive types: <code>boolean, char, byte, short, int, long, |
| 193 |
float, double</code></p> |
| 194 |
<li>The wrapper classes for Java primitive types</p> |
| 195 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math"><CODE>BigDecimal</CODE></A></p> |
| 196 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math"><CODE>BigInteger</CODE></A></p> |
| 197 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><CODE>String</CODE></A></p> |
| 198 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><CODE>Date</CODE></A></p> |
| 199 |
</ul> |
| 200 |
|
| 201 |
<p>When null values are required (for optional key fields, for example), |
| 202 |
primitive wrapper classes must be used instead of primitive types.</p> |
| 203 |
|
| 204 |
<p>Simple types, enum types and array types do not require annotations to |
| 205 |
make them persistent.</p> |
| 206 |
|
| 207 |
<p><a name="proxyTypes"><strong>Complex and Proxy Types</strong></a></p> |
| 208 |
|
| 209 |
<p>Complex persistent classes must be annotated with <A HREF="../../../../com/sleepycat/persist/model/Entity.html" title="annotation in com.sleepycat.persist.model"><CODE>Entity</CODE></A> or |
| 210 |
<A HREF="../../../../com/sleepycat/persist/model/Persistent.html" title="annotation in com.sleepycat.persist.model"><CODE>Persistent</CODE></A>, or must be proxied by a persistent proxy class |
| 211 |
(described below). This includes entity classes, subclasses and |
| 212 |
superclasses, and all other complex classes referenced via fields of these |
| 213 |
classes.</p> |
| 214 |
|
| 215 |
<p>All complex persistent classes must have a default constructor. The |
| 216 |
default constructor may be <code>private</code>, package-private (default |
| 217 |
access), <code>protected</code>, or <code>public</code>. Other constructors are |
| 218 |
allowed but are not used by the persistence mechanism.</p> |
| 219 |
|
| 220 |
<p>It is sometimes desirable to store instances of a type that is externally |
| 221 |
defined and cannot be annotated or does not have a default constructor; for |
| 222 |
example, a class defined in the Java standard libraries or a 3rd party |
| 223 |
library. In this case, a <A HREF="../../../../com/sleepycat/persist/model/PersistentProxy.html" title="interface in com.sleepycat.persist.model"><CODE>PersistentProxy</CODE></A> class may be used to |
| 224 |
represent the stored values for the externally defined type. The proxy |
| 225 |
class itself must be annotated with <A HREF="../../../../com/sleepycat/persist/model/Persistent.html" title="annotation in com.sleepycat.persist.model"><CODE>Persistent</CODE></A> like other persistent |
| 226 |
classes, and the <A HREF="../../../../com/sleepycat/persist/model/Persistent.html#proxyFor()"><CODE>Persistent.proxyFor()</CODE></A> property must be specified.</p> |
| 227 |
|
| 228 |
<p>For convenience, built-in proxy classes are included for several common |
| 229 |
classes (listed below) in the Java library. If you wish, you may define |
| 230 |
your own <A HREF="../../../../com/sleepycat/persist/model/PersistentProxy.html" title="interface in com.sleepycat.persist.model"><CODE>PersistentProxy</CODE></A> to override these built-in proxies.</p> |
| 231 |
<ul> |
| 232 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util"><CODE>HashSet</CODE></A></li> |
| 233 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/TreeSet.html?is-external=true" title="class or interface in java.util"><CODE>TreeSet</CODE></A></li> |
| 234 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/HashMap.html?is-external=true" title="class or interface in java.util"><CODE>HashMap</CODE></A></li> |
| 235 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/TreeMap.html?is-external=true" title="class or interface in java.util"><CODE>TreeMap</CODE></A></li> |
| 236 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util"><CODE>ArrayList</CODE></A></li> |
| 237 |
<li><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/LinkedList.html?is-external=true" title="class or interface in java.util"><CODE>LinkedList</CODE></A></li> |
| 238 |
</ul> |
| 239 |
|
| 240 |
<p>Complex persistent types should in general be application-defined |
| 241 |
classes. This gives the application control over the persistent state and |
| 242 |
its evolution over time.</p> |
| 243 |
|
| 244 |
<p><strong>Other Type Restrictions</strong></p> |
| 245 |
|
| 246 |
<p>Entity classes and subclasses may not be used in field declarations for |
| 247 |
persistent types. Fields of entity classes and subclasses must be simple |
| 248 |
types or non-entity persistent types (annotated with <A HREF="../../../../com/sleepycat/persist/model/Persistent.html" title="annotation in com.sleepycat.persist.model"><CODE>Persistent</CODE></A> not |
| 249 |
with <A HREF="../../../../com/sleepycat/persist/model/Entity.html" title="annotation in com.sleepycat.persist.model"><CODE>Entity</CODE></A>).</p> |
| 250 |
|
| 251 |
<p>Entity classes, subclasses and superclasses may be <code>abstract</code> and |
| 252 |
may implement arbitrary interfaces. Interfaces do not need to be annotated |
| 253 |
with <A HREF="../../../../com/sleepycat/persist/model/Persistent.html" title="annotation in com.sleepycat.persist.model"><CODE>Persistent</CODE></A> in order to be used in a persistent class, since |
| 254 |
interfaces do not contain instance fields.</p> |
| 255 |
|
| 256 |
<p>Persistent instances of static nested classes are allowed, but the nested |
| 257 |
class must be annotated with <A HREF="../../../../com/sleepycat/persist/model/Persistent.html" title="annotation in com.sleepycat.persist.model"><CODE>Persistent</CODE></A> or <A HREF="../../../../com/sleepycat/persist/model/Entity.html" title="annotation in com.sleepycat.persist.model"><CODE>Entity</CODE></A>. Inner |
| 258 |
classes (non-static nested classes, including anonymous classes) are not |
| 259 |
currently allowed as persistent types.</p> |
| 260 |
|
| 261 |
<p>Arrays of simple and persistent complex types are allowed as fields of |
| 262 |
persistent types. Arrays may be multidimensional. However, an array may |
| 263 |
not be stored as a top level instance in a primary index. Only instances of |
| 264 |
entity classes and subclasses may be top level instances in a primary |
| 265 |
index.</p> |
| 266 |
|
| 267 |
<p><strong>Embedded Objects</strong></p> |
| 268 |
|
| 269 |
<p>As stated above, the embedded (or member) non-transient non-static fields |
| 270 |
of an entity class are themselves persistent and are stored along with their |
| 271 |
parent entity object. This allows embedded objects to be stored in an |
| 272 |
entity to an arbitrary depth.</p> |
| 273 |
|
| 274 |
<p>There is no arbitrary limit to the nesting depth of embedded objects |
| 275 |
within an entity; however, there is a practical limit. When an entity is |
| 276 |
marshalled, each level of nesting is implemented internally via recursive |
| 277 |
method calls. If the nesting depth is large enough, a <code>StackOverflowError</code> can occur. In practice, this has been observed with a |
| 278 |
nesting depth of 12,000, using the default Java stack size.</p> |
| 279 |
|
| 280 |
<p>This restriction on the nesting depth of embedded objects does not apply |
| 281 |
to cyclic references, since these are handled specially as described |
| 282 |
below.</p> |
| 283 |
|
| 284 |
<p><strong>Object Graphs</strong></p> |
| 285 |
|
| 286 |
<p>When an entity instance is stored, the graph of objects referenced via |
| 287 |
its fields is stored and retrieved as a graph. In other words, if a single |
| 288 |
instance is referenced by two or more fields when the entity is stored, the |
| 289 |
same will be true when the entity is retrieved.</p> |
| 290 |
|
| 291 |
<p>When a reference to a particular object is stored as a member field |
| 292 |
inside that object or one of its embedded objects, this is called a cyclic |
| 293 |
reference. Because multiple references to a single object are stored as |
| 294 |
such, cycles are also represented correctly and do not cause infinite |
| 295 |
recursion or infinite processing loops. If an entity containing a cyclic |
| 296 |
reference is stored, the cyclic reference will be present when the entity is |
| 297 |
retrieved.</p> |
| 298 |
|
| 299 |
<p>Note that the stored object graph is restricted in scope to a single |
| 300 |
entity instance. This is because each entity instance is stored separately. |
| 301 |
If two entities have a reference to the same object when stored, they will |
| 302 |
refer to two separate instances when the entities are retrieved.</p> |
| 303 |
<P> |
| 304 |
|
| 305 |
<P> |
| 306 |
<DL> |
| 307 |
<DT><B>See Also:</B><DD><A HREF="../../../../com/sleepycat/persist/model/Persistent.html" title="annotation in com.sleepycat.persist.model"><CODE>Persistent</CODE></A>, |
| 308 |
<A HREF="../../../../com/sleepycat/persist/model/PrimaryKey.html" title="annotation in com.sleepycat.persist.model"><CODE>PrimaryKey</CODE></A>, |
| 309 |
<A HREF="../../../../com/sleepycat/persist/model/SecondaryKey.html" title="annotation in com.sleepycat.persist.model"><CODE>SecondaryKey</CODE></A>, |
| 310 |
<A HREF="../../../../com/sleepycat/persist/model/KeyField.html" title="annotation in com.sleepycat.persist.model"><CODE>KeyField</CODE></A></DL> |
| 311 |
<HR> |
| 312 |
|
| 313 |
<P> |
| 314 |
|
| 315 |
|
| 316 |
<A NAME="annotation_type_optional_element_summary"></A> |
| 317 |
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| 318 |
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| 319 |
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| 320 |
<B>Optional Element Summary</B></FONT></TH> |
| 321 |
</TR> |
| 322 |
<TR BGCOLOR="white" CLASS="TableRowColor"> |
| 323 |
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 324 |
<CODE> int</CODE></FONT></TD> |
| 325 |
<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/Entity.html#version()">version</A></B></CODE> |
| 326 |
|
| 327 |
<BR> |
| 328 |
Identifies a new version of a class when an incompatible class change |
| 329 |
has been made.</TD> |
| 330 |
</TR> |
| 331 |
</TABLE> |
| 332 |
|
| 333 |
<P> |
| 334 |
<A NAME="version()"></A><H3> |
| 335 |
version</H3> |
| 336 |
<PRE> |
| 337 |
public abstract int <B>version</B></PRE> |
| 338 |
<DL> |
| 339 |
<DD>Identifies a new version of a class when an incompatible class change |
| 340 |
has been made. Prior versions of a class are referred to by version |
| 341 |
number to perform class evolution and conversion using <A HREF="../../../../com/sleepycat/persist/evolve/Mutations.html" title="class in com.sleepycat.persist.evolve"><CODE>Mutations</CODE></A>. |
| 342 |
|
| 343 |
<p>The first version of a class is version zero, if <A HREF="../../../../com/sleepycat/persist/model/Entity.html#version()"><CODE>version()</CODE></A> is |
| 344 |
not specified. When an incompatible class change is made, a version |
| 345 |
number must be assigned using <A HREF="../../../../com/sleepycat/persist/model/Entity.html#version()"><CODE>version()</CODE></A> that is higher than the |
| 346 |
previous version number for the class. If this is not done, an <A HREF="../../../../com/sleepycat/persist/evolve/IncompatibleClassException.html" title="class in com.sleepycat.persist.evolve"><CODE>IncompatibleClassException</CODE></A> will be thrown when the store is opened.</p> |
| 347 |
<P> |
| 348 |
<DD><DL> |
| 349 |
</DL> |
| 350 |
</DD> |
| 351 |
<DD><DL> |
| 352 |
</DL> |
| 353 |
<DL> |
| 354 |
<DT><B>Default:</B><DD>0</DD> |
| 355 |
</DL> |
| 356 |
</DL> |
| 357 |
|
| 358 |
<HR> |
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
<A NAME="navbar_bottom"></A> |
| 363 |
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| 364 |
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| 365 |
<TR> |
| 366 |
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| 367 |
<A NAME="navbar_bottom_firstrow"></A> |
| 368 |
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| 369 |
<TR ALIGN="center" VALIGN="top"> |
| 370 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| 371 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| 372 |
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 373 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Entity.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| 374 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 375 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 376 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 377 |
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| 378 |
</TR> |
| 379 |
</TABLE> |
| 380 |
</TD> |
| 381 |
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| 382 |
<b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM> |
| 383 |
</TD> |
| 384 |
</TR> |
| 385 |
|
| 386 |
<TR> |
| 387 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 388 |
<A HREF="../../../../com/sleepycat/persist/model/DeleteAction.html" title="enum in com.sleepycat.persist.model"><B>PREV CLASS</B></A> |
| 389 |
<A HREF="../../../../com/sleepycat/persist/model/EntityMetadata.html" title="class in com.sleepycat.persist.model"><B>NEXT CLASS</B></A></FONT></TD> |
| 390 |
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 391 |
<A HREF="../../../../index.html?com/sleepycat/persist/model/Entity.html" target="_top"><B>FRAMES</B></A> |
| 392 |
<A HREF="Entity.html" target="_top"><B>NO FRAMES</B></A> |
| 393 |
<SCRIPT type="text/javascript"> |
| 394 |
<!-- |
| 395 |
if(window==top) { |
| 396 |
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| 397 |
} |
| 398 |
//--> |
| 399 |
</SCRIPT> |
| 400 |
<NOSCRIPT> |
| 401 |
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| 402 |
</NOSCRIPT> |
| 403 |
|
| 404 |
|
| 405 |
</FONT></TD> |
| 406 |
</TR> |
| 407 |
<TR> |
| 408 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 409 |
SUMMARY: REQUIRED | <A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD> |
| 410 |
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 411 |
DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD> |
| 412 |
</TR> |
| 413 |
</TABLE> |
| 414 |
<A NAME="skip-navbar_bottom"></A> |
| 415 |
|
| 416 |
|
| 417 |
<HR> |
| 418 |
<font size=1>Copyright (c) 1996, 2013 Oracle and/or its affiliates. All rights reserved.</font> |
| 419 |
</BODY> |
| 420 |
</HTML> |