From: <one...@us...> - 2002-11-07 16:24:43
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/html In directory usw-pr-cvs1:/tmp/cvs-serv26764/reference/html Modified Files: or-mapping.html Log Message: new faqs Index: or-mapping.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html/or-mapping.html,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** or-mapping.html 5 Nov 2002 13:40:53 -0000 1.30 --- or-mapping.html 7 Nov 2002 16:24:09 -0000 1.31 *************** *** 226,233 **** </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="or-mapping-s1-4b"></a>4.1.5. composite-id</h3></div></div><pre class="programlisting"><composite-id name="propertyName" ! class="className" unsaved-value="any|none|null"> ! <key-property name="propertyName" type="typename"/> ...... </composite-id></pre><p> --- 226,234 ---- </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="or-mapping-s1-4b"></a>4.1.5. composite-id</h3></div></div><pre class="programlisting"><composite-id name="propertyName" ! class="ClassName" unsaved-value="any|none|null"> ! <key-property name="propertyName" type="typename" column="column_name"/> ! <key-many-to-one name="propertyName class="ClassName" column="column_name"/> ...... </composite-id></pre><p> *************** *** 240,243 **** --- 241,247 ---- <property name="dependent"/> </composite-id></pre><p> + Your persistent class <span class="emphasis"><em>must</em></span> override <tt>equals()</tt> + and <tt>hashCode()</tt> to implement composite identifier equality. + </p><p> Unfortunately, this approach to composite identifiers means that a persistent object is its own identifier. There is no convenient "handle" other than the object itself. *************** *** 503,507 **** </set> <joined-subclass name="eg.DomesticCat"> ! <key column="CAT_ID"/> <property name="name" type="string"/> </joined-subclass> --- 507,511 ---- </set> <joined-subclass name="eg.DomesticCat"> ! <key column="CAT"/> <property name="name" type="string"/> </joined-subclass> |