1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<!--NewPage--> 3<HTML> 4<HEAD> 5<!-- Generated by javadoc (build 1.6.0_03) on Mon Apr 12 16:25:50 EDT 2010 --> 6<TITLE> 7EntityModel (Oracle - Berkeley DB Java API) 8</TITLE> 9 10<META NAME="date" CONTENT="2010-04-12"> 11 12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../style.css" TITLE="Style"> 13 14<SCRIPT type="text/javascript"> 15function windowTitle() 16{ 17 if (location.href.indexOf('is-external=true') == -1) { 18 parent.document.title="EntityModel (Oracle - Berkeley DB Java API)"; 19 } 20} 21</SCRIPT> 22<NOSCRIPT> 23</NOSCRIPT> 24 25</HEAD> 26 27<BODY BGCOLOR="white" onload="windowTitle();"> 28<HR> 29 30 31<!-- ========= START OF TOP NAVBAR ======= --> 32<A NAME="navbar_top"><!-- --></A> 33<A HREF="#skip-navbar_top" title="Skip navigation links"></A> 34<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 35<TR> 36<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 37<A NAME="navbar_top_firstrow"><!-- --></A> 38<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 39 <TR ALIGN="center" VALIGN="top"> 40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EntityModel.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 48 </TR> 49</TABLE> 50</TD> 51<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 52<b>Berkeley DB</b><br><font size="-1"> version 4.8.30</font></EM> 53</TD> 54</TR> 55 56<TR> 57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 58 <A HREF="../../../../com/sleepycat/persist/model/EntityMetadata.html" title="class in com.sleepycat.persist.model"><B>PREV CLASS</B></A> 59 <A HREF="../../../../com/sleepycat/persist/model/FieldMetadata.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/EntityModel.html" target="_top"><B>FRAMES</B></A> 62 <A HREF="EntityModel.html" target="_top"><B>NO FRAMES</B></A> 63 <SCRIPT type="text/javascript"> 64 <!-- 65 if(window==top) { 66 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 67 } 68 //--> 69</SCRIPT> 70<NOSCRIPT> 71 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 72</NOSCRIPT> 73 74 75</FONT></TD> 76</TR> 77<TR> 78<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 79 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 81DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 82</TR> 83</TABLE> 84<A NAME="skip-navbar_top"></A> 85<!-- ========= END OF TOP NAVBAR ========= --> 86 87<HR> 88<!-- ======== START OF CLASS DATA ======== --> 89<H2> 90<FONT SIZE="-1"> 91com.sleepycat.persist.model</FONT> 92<BR> 93Class EntityModel</H2> 94<PRE> 95<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A> 96 <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.persist.model.EntityModel</B> 97</PRE> 98<DL> 99<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../com/sleepycat/persist/model/AnnotationModel.html" title="class in com.sleepycat.persist.model">AnnotationModel</A></DD> 100</DL> 101<HR> 102<DL> 103<DT><PRE>public abstract class <B>EntityModel</B><DT>extends <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL> 104</PRE> 105 106<P> 107The base class for classes that provide entity model metadata. An <A HREF="../../../../com/sleepycat/persist/model/EntityModel.html" title="class in com.sleepycat.persist.model"><CODE>EntityModel</CODE></A> defines entity classes, primary keys, secondary keys, and 108 relationships between entities. For each entity class that is part of the 109 model, a single <A HREF="../../../../com/sleepycat/persist/PrimaryIndex.html" title="class in com.sleepycat.persist"><CODE>PrimaryIndex</CODE></A> object and zero or more <A HREF="../../../../com/sleepycat/persist/SecondaryIndex.html" title="class in com.sleepycat.persist"><CODE>SecondaryIndex</CODE></A> objects may be accessed via an <A HREF="../../../../com/sleepycat/persist/EntityStore.html" title="class in com.sleepycat.persist"><CODE>EntityStore</CODE></A>. 110 111 <p>The built-in entity model, the <A HREF="../../../../com/sleepycat/persist/model/AnnotationModel.html" title="class in com.sleepycat.persist.model"><CODE>AnnotationModel</CODE></A>, is based on 112 annotations that are added to entity classes and their key fields. 113 Annotations are used in the examples in this package, and it is expected 114 that annotations will normally be used; most readers should therefore skip 115 to the <A HREF="../../../../com/sleepycat/persist/model/AnnotationModel.html" title="class in com.sleepycat.persist.model"><CODE>AnnotationModel</CODE></A> class. However, a custom entity model class 116 may define its own metadata. This can be used to define entity classes and 117 keys using mechanisms other than annotations.</p> 118 119 <p>A concrete entity model class should extend this class and implement the 120 <A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getClassMetadata(java.lang.String)"><CODE>getClassMetadata(java.lang.String)</CODE></A>, <A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getEntityMetadata(java.lang.String)"><CODE>getEntityMetadata(java.lang.String)</CODE></A> and <A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getKnownClasses()"><CODE>getKnownClasses()</CODE></A> methods.</p> 121 122 <p>This is an abstract class rather than an interface to allow adding 123 capabilities to the model at a future date without causing 124 incompatibilities. For example, a method may be added in the future for 125 returning new information about the model and subclasses may override this 126 method to return the new information. Any new methods will have default 127 implementations that return default values, and the use of the new 128 information will be optional.</p> 129<P> 130 131<P> 132<HR> 133 134<P> 135 136<!-- ======== CONSTRUCTOR SUMMARY ======== --> 137 138<A NAME="constructor_summary"><!-- --></A> 139<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 140<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 141<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 142<B>Constructor Summary</B></FONT></TH> 143</TR> 144<TR BGCOLOR="white" CLASS="TableRowColor"> 145<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 146<CODE>protected </CODE></FONT></TD> 147<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#EntityModel()">EntityModel</A></B>()</CODE> 148 149<BR> 150 The default constructor for use by subclasses.</TD> 151</TR> 152</TABLE> 153 154<!-- ========== METHOD SUMMARY =========== --> 155 156<A NAME="method_summary"><!-- --></A> 157<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 158<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 159<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> 160<B>Method Summary</B></FONT></TH> 161</TR> 162<TR BGCOLOR="white" CLASS="TableRowColor"> 163<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 164<CODE>static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A></CODE></FONT></TD> 165<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#classForName(java.lang.String)">classForName</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className)</CODE> 166 167<BR> 168 Calls Class.forName with the current thread context class loader.</TD> 169</TR> 170<TR BGCOLOR="white" CLASS="TableRowColor"> 171<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 172<CODE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> 173<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#convertRawObject(com.sleepycat.persist.raw.RawObject)">convertRawObject</A></B>(<A HREF="../../../../com/sleepycat/persist/raw/RawObject.html" title="class in com.sleepycat.persist.raw">RawObject</A> raw)</CODE> 174 175<BR> 176 Converts a given raw object to a live object according to the current 177 class definitions.</TD> 178</TR> 179<TR BGCOLOR="white" CLASS="TableRowColor"> 180<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 181<CODE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A>></CODE></FONT></TD> 182<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getAllRawTypes()">getAllRawTypes</A></B>()</CODE> 183 184<BR> 185 Returns all versions of all known types.</TD> 186</TR> 187<TR BGCOLOR="white" CLASS="TableRowColor"> 188<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 189<CODE> <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A>></CODE></FONT></TD> 190<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getAllRawTypeVersions(java.lang.String)">getAllRawTypeVersions</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className)</CODE> 191 192<BR> 193 Returns all known versions of type information for a given class name, 194 or null if no persistent version of the class is known.</TD> 195</TR> 196<TR BGCOLOR="white" CLASS="TableRowColor"> 197<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 198<CODE>abstract <A HREF="../../../../com/sleepycat/persist/model/ClassMetadata.html" title="class in com.sleepycat.persist.model">ClassMetadata</A></CODE></FONT></TD> 199<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getClassMetadata(java.lang.String)">getClassMetadata</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className)</CODE> 200 201<BR> 202 Returns the metadata for a given persistent class name, including proxy 203 classes and entity classes.</TD> 204</TR> 205<TR BGCOLOR="white" CLASS="TableRowColor"> 206<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 207<CODE>abstract <A HREF="../../../../com/sleepycat/persist/model/EntityMetadata.html" title="class in com.sleepycat.persist.model">EntityMetadata</A></CODE></FONT></TD> 208<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getEntityMetadata(java.lang.String)">getEntityMetadata</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className)</CODE> 209 210<BR> 211 Returns the metadata for a given entity class name.</TD> 212</TR> 213<TR BGCOLOR="white" CLASS="TableRowColor"> 214<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 215<CODE>abstract <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>></CODE></FONT></TD> 216<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getKnownClasses()">getKnownClasses</A></B>()</CODE> 217 218<BR> 219 Returns the names of all known persistent classes.</TD> 220</TR> 221<TR BGCOLOR="white" CLASS="TableRowColor"> 222<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 223<CODE> <A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A></CODE></FONT></TD> 224<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getRawType(java.lang.String)">getRawType</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className)</CODE> 225 226<BR> 227 Returns the type information for the current version of a given class, 228 or null if the class is not currently persistent.</TD> 229</TR> 230<TR BGCOLOR="white" CLASS="TableRowColor"> 231<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 232<CODE> <A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A></CODE></FONT></TD> 233<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getRawTypeVersion(java.lang.String, int)">getRawTypeVersion</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className, 234 int version)</CODE> 235 236<BR> 237 Returns the type information for a given version of a given class, 238 or null if the given version of the class is unknown.</TD> 239</TR> 240<TR BGCOLOR="white" CLASS="TableRowColor"> 241<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 242<CODE> boolean</CODE></FONT></TD> 243<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#isOpen()">isOpen</A></B>()</CODE> 244 245<BR> 246 Returns whether the model is associated with an open store.</TD> 247</TR> 248<TR BGCOLOR="white" CLASS="TableRowColor"> 249<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> 250<CODE> void</CODE></FONT></TD> 251<TD><CODE><B><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#registerClass(java.lang.Class)">registerClass</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A> persistentClass)</CODE> 252 253<BR> 254 Registers a persistent class, most importantly, a <A HREF="../../../../com/sleepycat/persist/model/PersistentProxy.html" title="interface in com.sleepycat.persist.model"><CODE>PersistentProxy</CODE></A> class or entity subclass.</TD> 255</TR> 256</TABLE> 257 <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> 258<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 259<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> 260<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH> 261</TR> 262<TR BGCOLOR="white" CLASS="TableRowColor"> 263<TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> 264</TR> 265</TABLE> 266 267<P> 268 269<!-- ========= CONSTRUCTOR DETAIL ======== --> 270 271<A NAME="constructor_detail"><!-- --></A> 272<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 273<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 274<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 275<B>Constructor Detail</B></FONT></TH> 276</TR> 277</TABLE> 278 279<A NAME="EntityModel()"><!-- --></A><H3> 280EntityModel</H3> 281<PRE> 282protected <B>EntityModel</B>()</PRE> 283<DL> 284<DD>The default constructor for use by subclasses. 285<P> 286</DL> 287 288<!-- ============ METHOD DETAIL ========== --> 289 290<A NAME="method_detail"><!-- --></A> 291<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> 292<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> 293<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> 294<B>Method Detail</B></FONT></TH> 295</TR> 296</TABLE> 297 298<A NAME="isOpen()"><!-- --></A><H3> 299isOpen</H3> 300<PRE> 301public final boolean <B>isOpen</B>()</PRE> 302<DL> 303<DD>Returns whether the model is associated with an open store. 304 305 <p>The <A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#registerClass(java.lang.Class)"><CODE>registerClass(java.lang.Class)</CODE></A> method may only be called when the model 306 is not yet open. Certain other methods may only be called when the 307 model is open:</p> 308 <ul> 309 <li><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#convertRawObject(com.sleepycat.persist.raw.RawObject)"><CODE>convertRawObject(com.sleepycat.persist.raw.RawObject)</CODE></A></li> 310 <li><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getAllRawTypeVersions(java.lang.String)"><CODE>getAllRawTypeVersions(java.lang.String)</CODE></A></li> 311 <li><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getRawType(java.lang.String)"><CODE>getRawType(java.lang.String)</CODE></A></li> 312 <li><A HREF="../../../../com/sleepycat/persist/model/EntityModel.html#getRawTypeVersion(java.lang.String, int)"><CODE>getRawTypeVersion(java.lang.String, int)</CODE></A></li> 313 </ul> 314<P> 315<DD><DL> 316</DL> 317</DD> 318</DL> 319<HR> 320 321<A NAME="registerClass(java.lang.Class)"><!-- --></A><H3> 322registerClass</H3> 323<PRE> 324public final void <B>registerClass</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A> persistentClass)</PRE> 325<DL> 326<DD>Registers a persistent class, most importantly, a <A HREF="../../../../com/sleepycat/persist/model/PersistentProxy.html" title="interface in com.sleepycat.persist.model"><CODE>PersistentProxy</CODE></A> class or entity subclass. 327 328 <p>Any persistent class may be registered in advance of using it, to 329 avoid the overhead of updating the catalog database when an instance of 330 the class is first stored. This method <em>must</em> be called in two 331 cases:</p> 332 <ol> 333 <li>to register all <A HREF="../../../../com/sleepycat/persist/model/PersistentProxy.html" title="interface in com.sleepycat.persist.model"><CODE>PersistentProxy</CODE></A> classes, and</li> 334 <li>to register an entity subclass defining a secondary key, if <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> is not called for the 335 subclass.</li> 336 </ol> 337 338 <p>For example:</p> 339 340 <pre class="code"> 341 EntityModel model = new AnnotationModel(); 342 model.registerClass(MyProxy.class); 343 model.registerClass(MyEntitySubclass.class); 344 345 StoreConfig config = new StoreConfig(); 346 ... 347 config.setModel(model); 348 349 EntityStore store = new EntityStore(..., config);</pre> 350 351 <p>This method must be called before opening a store based on this 352 model.</p> 353<P> 354<DD><DL> 355 356<DT><B>Throws:</B> 357<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this method is called for a model that 358 is associated with an open store. 359<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the given class is not persistent 360 or has a different class loader than previously registered classes.</DL> 361</DD> 362</DL> 363<HR> 364 365<A NAME="getClassMetadata(java.lang.String)"><!-- --></A><H3> 366getClassMetadata</H3> 367<PRE> 368public abstract <A HREF="../../../../com/sleepycat/persist/model/ClassMetadata.html" title="class in com.sleepycat.persist.model">ClassMetadata</A> <B>getClassMetadata</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className)</PRE> 369<DL> 370<DD>Returns the metadata for a given persistent class name, including proxy 371 classes and entity classes. 372<P> 373<DD><DL> 374 375<DT><B>Returns:</B><DD>the metadata or null if the class is not persistent or does not 376 exist.</DL> 377</DD> 378</DL> 379<HR> 380 381<A NAME="getEntityMetadata(java.lang.String)"><!-- --></A><H3> 382getEntityMetadata</H3> 383<PRE> 384public abstract <A HREF="../../../../com/sleepycat/persist/model/EntityMetadata.html" title="class in com.sleepycat.persist.model">EntityMetadata</A> <B>getEntityMetadata</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className)</PRE> 385<DL> 386<DD>Returns the metadata for a given entity class name. 387<P> 388<DD><DL> 389 390<DT><B>Returns:</B><DD>the metadata or null if the class is not an entity class or does 391 not exist.</DL> 392</DD> 393</DL> 394<HR> 395 396<A NAME="getKnownClasses()"><!-- --></A><H3> 397getKnownClasses</H3> 398<PRE> 399public abstract <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A><<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>> <B>getKnownClasses</B>()</PRE> 400<DL> 401<DD>Returns the names of all known persistent classes. A type becomes known 402 when an instance of the type is stored for the first time or metadata or 403 type information is queried for a specific class name. 404<P> 405<DD><DL> 406 407<DT><B>Returns:</B><DD>an unmodifiable set of class names. 408<DT><B>Throws:</B> 409<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this method is called for a model that 410 is not associated with an open store.</DL> 411</DD> 412</DL> 413<HR> 414 415<A NAME="getRawType(java.lang.String)"><!-- --></A><H3> 416getRawType</H3> 417<PRE> 418public final <A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A> <B>getRawType</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className)</PRE> 419<DL> 420<DD>Returns the type information for the current version of a given class, 421 or null if the class is not currently persistent. 422<P> 423<DD><DL> 424<DT><B>Parameters:</B><DD><CODE>className</CODE> - the name of the current version of the class. 425<DT><B>Throws:</B> 426<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this method is called for a model that 427 is not associated with an open store.</DL> 428</DD> 429</DL> 430<HR> 431 432<A NAME="getRawTypeVersion(java.lang.String, int)"><!-- --></A><H3> 433getRawTypeVersion</H3> 434<PRE> 435public final <A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A> <B>getRawTypeVersion</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className, 436 int version)</PRE> 437<DL> 438<DD>Returns the type information for a given version of a given class, 439 or null if the given version of the class is unknown. 440<P> 441<DD><DL> 442<DT><B>Parameters:</B><DD><CODE>className</CODE> - the name of the latest version of the class.<DD><CODE>version</CODE> - the desired version of the class. 443<DT><B>Throws:</B> 444<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this method is called for a model that 445 is not associated with an open store.</DL> 446</DD> 447</DL> 448<HR> 449 450<A NAME="getAllRawTypeVersions(java.lang.String)"><!-- --></A><H3> 451getAllRawTypeVersions</H3> 452<PRE> 453public final <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A>> <B>getAllRawTypeVersions</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className)</PRE> 454<DL> 455<DD>Returns all known versions of type information for a given class name, 456 or null if no persistent version of the class is known. 457<P> 458<DD><DL> 459<DT><B>Parameters:</B><DD><CODE>className</CODE> - the name of the latest version of the class. 460<DT><B>Returns:</B><DD>an unmodifiable list of types for the given class name in order 461 from most recent to least recent. 462<DT><B>Throws:</B> 463<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this method is called for a model that 464 is not associated with an open store.</DL> 465</DD> 466</DL> 467<HR> 468 469<A NAME="getAllRawTypes()"><!-- --></A><H3> 470getAllRawTypes</H3> 471<PRE> 472public final <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A><<A HREF="../../../../com/sleepycat/persist/raw/RawType.html" title="interface in com.sleepycat.persist.raw">RawType</A>> <B>getAllRawTypes</B>()</PRE> 473<DL> 474<DD>Returns all versions of all known types. 475<P> 476<DD><DL> 477 478<DT><B>Returns:</B><DD>an unmodifiable list of types. 479<DT><B>Throws:</B> 480<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this method is called for a model that 481 is not associated with an open store.</DL> 482</DD> 483</DL> 484<HR> 485 486<A NAME="convertRawObject(com.sleepycat.persist.raw.RawObject)"><!-- --></A><H3> 487convertRawObject</H3> 488<PRE> 489public final <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>convertRawObject</B>(<A HREF="../../../../com/sleepycat/persist/raw/RawObject.html" title="class in com.sleepycat.persist.raw">RawObject</A> raw)</PRE> 490<DL> 491<DD>Converts a given raw object to a live object according to the current 492 class definitions. 493 494 <p>The given raw object must conform to the current class definitions. 495 However, the raw type (<A HREF="../../../../com/sleepycat/persist/raw/RawObject.html#getType()"><CODE>RawObject.getType()</CODE></A>) is allowed to be from 496 a different store, as long as the class names and the value types match. 497 This allows converting raw objects that are read from one store to live 498 objects in another store, for example, in a conversion program.</p> 499<P> 500<DD><DL> 501</DL> 502</DD> 503</DL> 504<HR> 505 506<A NAME="classForName(java.lang.String)"><!-- --></A><H3> 507classForName</H3> 508<PRE> 509public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A> <B>classForName</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> className) 510 throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</A></PRE> 511<DL> 512<DD>Calls Class.forName with the current thread context class loader. This 513 method should be called by entity model implementations instead of 514 calling Class.forName whenever loading an application class. 515<P> 516<DD><DL> 517 518<DT><B>Throws:</B> 519<DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ClassNotFoundException.html?is-external=true" title="class or interface in java.lang">ClassNotFoundException</A></CODE></DL> 520</DD> 521</DL> 522<!-- ========= END OF CLASS DATA ========= --> 523<HR> 524 525 526<!-- ======= START OF BOTTOM NAVBAR ====== --> 527<A NAME="navbar_bottom"><!-- --></A> 528<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> 529<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> 530<TR> 531<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> 532<A NAME="navbar_bottom_firstrow"><!-- --></A> 533<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> 534 <TR ALIGN="center" VALIGN="top"> 535 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> 536 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> 537 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> 538 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EntityModel.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> 539 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> 540 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> 541 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> 542 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> 543 </TR> 544</TABLE> 545</TD> 546<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> 547<b>Berkeley DB</b><br><font size="-1"> version 4.8.30</font></EM> 548</TD> 549</TR> 550 551<TR> 552<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 553 <A HREF="../../../../com/sleepycat/persist/model/EntityMetadata.html" title="class in com.sleepycat.persist.model"><B>PREV CLASS</B></A> 554 <A HREF="../../../../com/sleepycat/persist/model/FieldMetadata.html" title="class in com.sleepycat.persist.model"><B>NEXT CLASS</B></A></FONT></TD> 555<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> 556 <A HREF="../../../../index.html?com/sleepycat/persist/model/EntityModel.html" target="_top"><B>FRAMES</B></A> 557 <A HREF="EntityModel.html" target="_top"><B>NO FRAMES</B></A> 558 <SCRIPT type="text/javascript"> 559 <!-- 560 if(window==top) { 561 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); 562 } 563 //--> 564</SCRIPT> 565<NOSCRIPT> 566 <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> 567</NOSCRIPT> 568 569 570</FONT></TD> 571</TR> 572<TR> 573<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 574 SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> 575<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> 576DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> 577</TR> 578</TABLE> 579<A NAME="skip-navbar_bottom"></A> 580<!-- ======== END OF BOTTOM NAVBAR ======= --> 581 582<HR> 583<font size=1>Copyright (c) 1996-2009 Oracle. All rights reserved.</font> 584</BODY> 585</HTML> 586