From: <tu...@us...> - 2003-01-28 13:25:15
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/html In directory sc8-pr-cvs1:/tmp/cvs-serv4176/html Modified Files: adv-or-mapping.html architecture.html best-practices.html examples.html index.html manipulating-data.html or-mapping.html query-language.html session-configuration.html transactions.html Log Message: Updated doco Index: adv-or-mapping.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/adv-or-mapping.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** adv-or-mapping.html 1 Jan 2003 13:43:03 -0000 1.1.1.1 --- adv-or-mapping.html 28 Jan 2003 13:25:09 -0000 1.2 *************** *** 1,5 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 5. Advanced O/R Mapping</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.49"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="next" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Advanced O/R Mapping</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="or-mapping.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manipulating-data.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="adv-or-mapping"></a>Chapter 5. Advanced O/R Mapping</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s2">Components</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-2">In Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-1">Mapping</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s1"></a>Collections</h2></div></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-1"></a>Persistent Collection Styles</h3></div></div><p> This section does not contain much example Java code. We assume you already know how to use Java's collections framework. If so, theres not really anything more --- 1,5 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 5. Advanced O/R Mapping</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.49"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="up" href="index.html" title="Hibernate Reference Documentation"><link rel="previous" href="or-mapping.html" title="Chapter 4. Basic O/R Mapping"><link rel="next" href="manipulating-data.html" title="Chapter 6. Manipulating Persistent Data"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Advanced O/R Mapping</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="or-mapping.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manipulating-data.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="adv-or-mapping"></a>Chapter 5. Advanced O/R Mapping</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s2">Components</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-2">In Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-3">As Composite Identifiers</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-4">Dynabean components</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-1">Mapping</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s1"></a>Collections</h2></div></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-1"></a>Persistent Collections</h3></div></div><p> This section does not contain much example Java code. We assume you already know how to use Java's collections framework. If so, theres not really anything more *************** *** 44,53 **** (HashSet) cat.getKittens(); //Error!</pre><p> Collections (and subcollections) obey the usual rules for value types: no shared ! references, created and deleted along with containing entity. </p><p> ! Collections may contain any other Hibernate type. All collection types except ! <tt>Set</tt> and bag have an <span class="emphasis"><i>index</i></span> - an array or list ! index or map key. The index of a <tt>Map</tt> may be of any basic type, an ! entity type or even a composite type (it may not be a collection). </p><p> There are quite a range of mappings that can be generated for collections, --- 44,70 ---- (HashSet) cat.getKittens(); //Error!</pre><p> Collections (and subcollections) obey the usual rules for value types: no shared ! references, created and deleted along with containing entity. Due to the underlying ! relational model, they do not support null value semantics; Hibernate does not ! distinguish between a null collection reference and an empty collection. </p><p> ! Collection instances are distinguished in the database by a foreign key to ! the owning entity. This foreign key is referred to as the <span class="emphasis"><i>collection key ! </i></span> (Collections may not contain other collections). The collection key ! is mapped by the <tt><key></tt> element. ! </p><p> ! Collections may contain almost any other Hibernate type, including all basic types, ! custom types, entity types and components. Collections may not contain other ! collections. The contained type is referred to as the <span class="emphasis"><i>collection element ! type</i></span>. Collection elements are mapped by using <tt><element></tt>, ! <tt><composite-element></tt>, <tt><one-to-many></tt> or ! <tt><many-to-many></tt>. ! </p><p> ! All collection types except <tt>Set</tt> and bag have an <span class="emphasis"><i>index ! </i></span> column - a column that maps to an array or <tt>List</tt> index or ! <tt>Map</tt> key. The index of a <tt>Map</tt> may be of any ! basic type, an entity type or even a composite type (it may not be a collection). The ! index of an array or list is always of type <tt>integer</tt>. Indexes are ! mapped using <tt><index></tt>, <tt><index-many-to-many></tt> ! or <tt><composite-index></tt>. </p><p> There are quite a range of mappings that can be generated for collections, *************** *** 55,80 **** schema generation tool to get a feeling for how various mapping declarations translate to database tables. - </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-2"></a>Toplevel and Nested Collections</h3></div></div><p> - All collections require an identifier. The identifier is never exposed to the - application. A <span class="emphasis"><i>nested</i></span> collection is one whose identifier - is assigned from its containing object. A <span class="emphasis"><i>toplevel</i></span> - collection's identifier is generated by a Hibernate ID generator. Toplevel - collections require an extra column in the table of the owning class (holding - the collection's identifier). - </p><p> - Nested collection roles are declared inside a - <tt>class</tt> or <tt>component</tt> tag. - The role name is the name of a property of that class or component and collections - of that role may only be referenced by that property. This is intended to be the - most common use of collections. However, nested collections may <span class="emphasis"><i>not</i></span> - be contained in other collections.....Hibernate won't even let you declare such - a mapping. Nested collections do not distinguish between a null collection - reference and an empty collection. - </p><p> - Toplevel collections are declared directly beneath the root element of a mapping - and may be referenced by a properties of any class or component, or by another - collection. They require their own ID generator (but may not use - <tt>native</tt> ID generation). Toplevel collections - may be contained in other collections. </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-3"></a>Mapping a Collection</h3></div></div><p> Collections are declared by the --- 72,75 ---- *************** *** 87,94 **** <tt><map></tt> is representative: </p><pre class="programlisting"><map ! role="roleName" table="table_name" schema="schema_name lazy="true|false" cascade="all|none|save-update|delete" sort="unsorted|natural|comparatorClass" --- 82,90 ---- <tt><map></tt> is representative: </p><pre class="programlisting"><map ! name="propertyName" table="table_name" schema="schema_name lazy="true|false" + inverse="true|false" cascade="all|none|save-update|delete" sort="unsorted|natural|comparatorClass" *************** *** 99,106 **** <element .... /> </map></pre><div class="itemizedlist"><ul type="disc"><li><p> ! <tt>role</tt> the name of the toplevel collection role ! or nested collection property </p></li><li><p> ! <tt>table</tt> (optional - defaults to role name) the name of the collection table (not used for one-to-many associations) </p></li><li><p> --- 95,101 ---- <element .... /> </map></pre><div class="itemizedlist"><ul type="disc"><li><p> ! <tt>name</tt> the collection property name </p></li><li><p> ! <tt>table</tt> (optional - defaults to property name) the name of the collection table (not used for one-to-many associations) </p></li><li><p> *************** *** 111,114 **** --- 106,112 ---- enable lazy initialization (not used for arrays) </p></li><li><p> + <tt>inverse</tt> (optional - defaults to <tt>false</tt>) + mark this collection as the "inverse" end of a bidirectional association + </p></li><li><p> <tt>cascade</tt> (optional - defaults to <tt>none</tt>) enable operations to cascade to child entities (not used for toplevel *************** *** 121,194 **** that define the iteration order of the <tt>Map</tt>, <tt>Set</tt> or bag, together with an optional <tt>asc</tt> or <tt>desc</tt>. ! </p></li></ul></div></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-4"></a>Mapping a Property to a Toplevel Collection</h3></div></div><p> ! The <tt><collection></tt> and ! <tt><subcollection></tt> elements map a property to a ! toplevel collection or a collection to a subcollection. ! </p><pre class="programlisting"><collection ! name="propertyName" ! column="column_name" ! role="some_role" ! cascade="all|none|save-update|delete"/> ! ! <subcollection ! column="column_name" ! role="some_role"/></pre><div class="itemizedlist"><ul type="disc"><li><p> ! <tt>name</tt> the property name ! </p></li><li><p> ! <tt>role</tt> the name of the toplevel collection role ! </p></li><li><p> ! <tt>column</tt> (optional - defaults to property name) ! the column holding the toplevel collection identifier ! </p></li><li><p> ! <tt>cascade</tt> (optional) enable cascaded operations ! </p></li></ul></div><p> ! Note that enabling cascades for a collection will force operations to cascade ! all the way down a heirarchy of subcollections to the leaf entity objects. ! </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-5"></a>Collections of Values and Many To Many Associations</h3></div></div><p> ! Most collection roles require a table of their own. This includes any collection ! of values and any collection of entities that has the natural semantics for a ! Java collection. The table requires an identifier column, an element column (or ! column<span class="emphasis"><i>s</i></span> if it is a collection of components) and possibly ! an index column. </p><p> A collection of entities with its own table corresponds to the relational notion of <span class="emphasis"><i>many-to-many association</i></span>. A many to many association is the ! most natural mapping of a Java collection but is not always the best relational model. </p><p> Examples: </p><p> ! First, a set of strings. This is a nested collection so it doesn't declare its ! own key type or generator (even nested collections declare a ! <tt><key></tt> element - the foreign key of their ! owning class): ! </p><pre class="programlisting"><set role="names" table="NAMES"> <key column="GROUPID"/> <element column="NAME" type="string"/> </set></pre><p> ! A nested bag containing integers (with an iteration order determined by the <tt>order-by</tt> attribute): ! </p><pre class="programlisting"><bag role="sizes" table="SIZES" order-by="SIZE ASC"> <key column="OWNER"/> <element column="SIZE" type="integer"/> </bag></pre><p> ! A nested array of entities - in this case, a many to many association (note that the entities are lifecycle objects, <tt>cascade="all"</tt>): ! </p><pre class="programlisting"><array role="foos" table="BAR_FOOS" cascade="all"> <key column="BAR_ID"/> <index column="I"/> <many-to-many column="FOO_ID" class="com.illflow.Foo"/> </array></pre><p> ! A toplevel map from string indices to dates (this might be a useful mapping ! style if many different classes all had collections living in the one table, or ! if the map was a subcollection): ! </p><pre class="programlisting"><map role="holidays" table="holidays" schema="dbo" order-by="hol_name asc"> ! <generated-key column="id" type="string"> ! <generator class="uuid.hex"/> ! </key> <index column="hol_name" type="string"/> <element column="hol_date" type="date"/> </map></pre><p> ! A nested list of components: ! </p><pre class="programlisting"><list role="carComponents" table="car_components"> <key column="car_id"/> <index column="posn"/> --- 119,159 ---- that define the iteration order of the <tt>Map</tt>, <tt>Set</tt> or bag, together with an optional <tt>asc</tt> or <tt>desc</tt>. ! </p></li></ul></div></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-5"></a>Collections of Values and Many To Many Associations</h3></div></div><p> ! A collection table is required for any collection of values and any collection of entities ! mapped as a many-to-many association (the natural semantics for a Java collection). The ! table requires identifier column(s), element column(s) and possibly index column(s). </p><p> A collection of entities with its own table corresponds to the relational notion of <span class="emphasis"><i>many-to-many association</i></span>. A many to many association is the ! most natural mapping of a Java collection but is not usually the best relational model. </p><p> Examples: </p><p> ! First, a set of strings: ! </p><pre class="programlisting"><set name="names" table="NAMES"> <key column="GROUPID"/> <element column="NAME" type="string"/> </set></pre><p> ! A bag containing integers (with an iteration order determined by the <tt>order-by</tt> attribute): ! </p><pre class="programlisting"><bag name="sizes" table="SIZES" order-by="SIZE ASC"> <key column="OWNER"/> <element column="SIZE" type="integer"/> </bag></pre><p> ! An array of entities - in this case, a many to many association (note that the entities are lifecycle objects, <tt>cascade="all"</tt>): ! </p><pre class="programlisting"><array name="foos" table="BAR_FOOS" cascade="all"> <key column="BAR_ID"/> <index column="I"/> <many-to-many column="FOO_ID" class="com.illflow.Foo"/> </array></pre><p> ! A map from string indices to dates: ! </p><pre class="programlisting"><map name="holidays" table="holidays" schema="dbo" order-by="hol_name asc"> ! <key column="id"/> <index column="hol_name" type="string"/> <element column="hol_date" type="date"/> </map></pre><p> ! A list of components: ! </p><pre class="programlisting"><list name="carComponents" table="car_components"> <key column="car_id"/> <index column="posn"/> *************** *** 201,207 **** A <span class="emphasis"><i>one to many association</i></span> links the tables of two classes <span class="emphasis"><i>directly</i></span>, with no intervening collection table. ! (This implements a <span class="emphasis"><i>one-to-many</i></span> relational ! model.) This model has higher performance but loses some of the semantics of ! Java collections: </p><div class="itemizedlist"><ul type="disc"><li><p> No null values may be contained in a map or set --- 166,171 ---- A <span class="emphasis"><i>one to many association</i></span> links the tables of two classes <span class="emphasis"><i>directly</i></span>, with no intervening collection table. ! (This implements a <span class="emphasis"><i>one-to-many</i></span> relational model.) This ! relational model loses some of the semantics of Java collections: </p><div class="itemizedlist"><ul type="disc"><li><p> No null values may be contained in a map or set *************** *** 222,231 **** </p><p> Example: ! </p><pre class="programlisting"><set role="bars" table="foobars"> <key column="foo_id"/> <one-to-many class="com.illflow.Bar"/> </set></pre><p> ! The <tt>one-to-many</tt> tag does not need to declare ! any columns. </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-7"></a>Lazy Initialization</h3></div></div><p> Collections (other than arrays) may be lazily initialized, meaning they load --- 186,194 ---- </p><p> Example: ! </p><pre class="programlisting"><set name="bars" table="foobars"> <key column="foo_id"/> <one-to-many class="com.illflow.Bar"/> </set></pre><p> ! The <tt>one-to-many</tt> tag does not need to declare any columns. </p></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-7"></a>Lazy Initialization</h3></div></div><p> Collections (other than arrays) may be lazily initialized, meaning they load *************** *** 256,272 **** </p><p> Declare a lazy collection using the optional <tt>lazy</tt> attribute ! </p><pre class="programlisting"><set role="names" table="NAMES" lazy="true"> <key column="group_id"/> <element column="NAME" type="string"/> </set></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-8"></a>Sorted Collections</h3></div></div><p> ! Hibernate supports collections implementing ! <tt>java.util.SortedMap</tt> and ! <tt>java.util.SortedSet</tt>. You must specify a ! comparator in the mapping file: ! </p><pre class="programlisting"><set role="names" sort="natural"> ... </set> ! <map role="holidays" sort="my.custom.StringComparator" lazy="true"> ... </map></pre><p> --- 219,233 ---- </p><p> Declare a lazy collection using the optional <tt>lazy</tt> attribute ! </p><pre class="programlisting"><set name="names" table="NAMES" lazy="true"> <key column="group_id"/> <element column="NAME" type="string"/> </set></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s1-8"></a>Sorted Collections</h3></div></div><p> ! Hibernate supports collections implementing <tt>java.util.SortedMap</tt> and ! <tt>java.util.SortedSet</tt>. You must specify a comparator in the mapping file: ! </p><pre class="programlisting"><set name="names" sort="natural"> ... </set> ! <map name="holidays" sort="my.custom.StringComparator" lazy="true"> ... </map></pre><p> *************** *** 294,321 **** You may specify a bidirectional many-to-many association simply by mapping two nested, many-to-many sets/bags to the same database table and declaring one end as ! <span class="emphasis"><i>readonly</i></span>. Heres an example of a bidirectional many-to-many association from a class back to <span class="emphasis"><i>itself</i></span>: </p><pre class="programlisting"><class name="eg.Node"> <id name="id" column="id"/> .... ! <bag role="accessibleTo" table="node_access" lazy="true"> <key column="to_node_id"/> <many-to-many class="eg.Node" column="from_node_id"/> </bag> ! <bag role="accessibleFrom" table="node_access" readonly="true" lazy="true"> <!-- readonly end --> <key column="from_node_id"/> <many-to-many class="eg.Node" column="to_node_id"/> </bag> </class></pre><p> ! Changes made to the readonly end of the association are <span class="emphasis"><i>not</i></span> ! persistent. </p><p> You may map a bidirectional one-to-many association by mapping a nested, one-to-many set / bag to the same table column(s) as a many-to-one association and ! declaring the many-valued end readonly. </p><pre class="programlisting"><class name="eg.Parent"> <id name="id" column="id"/> .... ! <set role="children" readonly="true" lazy="true"> <key column="parent_id"/> <one-to-many class="eg.Child"/> --- 255,282 ---- You may specify a bidirectional many-to-many association simply by mapping two nested, many-to-many sets/bags to the same database table and declaring one end as ! <span class="emphasis"><i>inverse</i></span>. Heres an example of a bidirectional many-to-many association from a class back to <span class="emphasis"><i>itself</i></span>: </p><pre class="programlisting"><class name="eg.Node"> <id name="id" column="id"/> .... ! <bag name="accessibleTo" table="node_access" lazy="true"> <key column="to_node_id"/> <many-to-many class="eg.Node" column="from_node_id"/> </bag> ! <bag name="accessibleFrom" table="node_access" inverse="true" lazy="true"> <!-- inverse end --> <key column="from_node_id"/> <many-to-many class="eg.Node" column="to_node_id"/> </bag> </class></pre><p> ! Changes made only to the inverse end of the association are <span class="emphasis"><i>not</i></span> ! persisted. </p><p> You may map a bidirectional one-to-many association by mapping a nested, one-to-many set / bag to the same table column(s) as a many-to-one association and ! declaring the many-valued end inverse. </p><pre class="programlisting"><class name="eg.Parent"> <id name="id" column="id"/> .... ! <set name="children" inverse="true" lazy="true"> <key column="parent_id"/> <one-to-many class="eg.Child"/> *************** *** 331,339 **** composite elements (discussed below). Another is to use a <tt>Map</tt> with an association as its index. ! </p><pre class="programlisting"><map role="contracts" lazy="true"> <key column="employer_id"/> <index-many-to-many column="employee_id" class="Employee"/> <one-to-many column="contract_id" class="Contract"/> ! </map></pre><pre class="programlisting"><map role="connections" lazy="true"> <key column="node1_id"/> <index-many-to-many column="node2_id" class="Node"/> --- 292,300 ---- composite elements (discussed below). Another is to use a <tt>Map</tt> with an association as its index. ! </p><pre class="programlisting"><map name="contracts" lazy="true"> <key column="employer_id"/> <index-many-to-many column="employee_id" class="Employee"/> <one-to-many column="contract_id" class="Contract"/> ! </map></pre><pre class="programlisting"><map name="connections" lazy="true"> <key column="node1_id"/> <index-many-to-many column="node2_id" class="Node"/> *************** *** 367,371 **** <generator class="sequence"/> </id> ! <set role="children" lazy="true"> <key type="long" column="parent_id"/> <one-to-many class="eg.Child"/> --- 328,332 ---- <generator class="sequence"/> </id> ! <set name="children" lazy="true"> <key type="long" column="parent_id"/> <one-to-many class="eg.Child"/> *************** *** 393,397 **** <generator class="sequence"/> </id> ! <set role="children" lazy="true" table="childset"> <key type="long" column="parent_id"/> <many-to-many class="eg.Child" column="child_id"/> --- 354,358 ---- <generator class="sequence"/> </id> ! <set name="children" lazy="true" table="childset"> <key type="long" column="parent_id"/> <many-to-many class="eg.Child" column="child_id"/> *************** *** 409,443 **** create table childset ( parent_id bigint, child_id bigint ) alter table childset add constraint childsetfk0 (parent_id) references parent ! alter table childset add constraint childsetfk1 (child_id) references child</pre><p> ! If many different classes contain sets of ! <tt>eg.Child</tt> or if, for some reason, we need to ! distinguish between a null collection reference and an empty set, a toplevel ! collection might be used: ! </p><pre class="programlisting"><hibernate-mapping> ! ! <set role="childset" lazy="true"> ! <generated-key type="long" column="id"> ! <generator class="sequence"/> ! </key> ! <many-to-many class="eg.Child" column="child_id"/> ! </set> ! ! <class name="eg.Parent> ! <id name="id"> ! <generator class="sequence"/> ! </id> ! <collection name="children" column="childset_id" role="childset"/> ! </class> ! ! <class name="eg.Child"> ! .... ! </class> ! ! </hibernate-mapping></pre><p> ! Table definitions: ! </p><pre class="programlisting">create table parent ( id bigint not null primary key, childset_id bigint ) ! create table child ( id bigint not null primary key, name varchar(255) ) ! create table childset ( id bigint, child_id bigint ) ! alter table childset add constraint childsetfk0 (child_id) references child</pre></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s2"></a>Components</h2></div></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s2-1"></a>As Dependent Objects</h3></div></div><p> A <span class="emphasis"><i>component</i></span> is a contained object persisted to the same table as its owner. The term "component" refers to the object-oriented notion --- 370,374 ---- create table childset ( parent_id bigint, child_id bigint ) alter table childset add constraint childsetfk0 (parent_id) references parent ! alter table childset add constraint childsetfk1 (child_id) references child</pre></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s2"></a>Components</h2></div></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s2-1"></a>As Dependent Objects</h3></div></div><p> A <span class="emphasis"><i>component</i></span> is a contained object persisted to the same table as its owner. The term "component" refers to the object-oriented notion *************** *** 533,540 **** replacing the <tt><element></tt> tag with a <tt><composite-element></tt> tag. ! </p><pre class="programlisting"><set role="some_names" lazy="true"> ! <key name="id" type="string"> ! <generator class="uuid.hex"/> ! </key> <composite-element class="eg.Name"> <!-- class attribute required --> <property name="initial"/> --- 464,469 ---- replacing the <tt><element></tt> tag with a <tt><composite-element></tt> tag. ! </p><pre class="programlisting"><set name="some_names" lazy="true"> ! <key column="id"/> <composite-element class="eg.Name"> <!-- class attribute required --> <property name="initial"/> *************** *** 543,548 **** </composite-element> </set></pre><p> ! Composite elements may contain components and even toplevel collections, ! but not nested collections. If your composite element itself contains components, use the <tt><nested-composite-element></tt> tag. This is a pretty exotic case - a collection of components which --- 472,477 ---- </composite-element> </set></pre><p> ! Composite elements may contain components not collections. If your composite ! element itself contains components, use the <tt><nested-composite-element></tt> tag. This is a pretty exotic case - a collection of components which *************** *** 562,566 **** </p><pre class="programlisting"><class name="eg.Order" .... > .... ! <set role="purchasedItems" lazy="true"> <key name="order_id"> <composite-element class="eg.Purchase"> --- 491,495 ---- </p><pre class="programlisting"><class name="eg.Order" .... > .... ! <set name="purchasedItems" lazy="true"> <key name="order_id"> <composite-element class="eg.Purchase"> *************** *** 573,577 **** </class></pre><p>Even ternary (or quaternary, etc) associations are possible:</p><pre class="programlisting"><class name="eg.Order" .... > .... ! <set role="purchasedItems" lazy="true"> <key name="order_id"> <composite-element class="eg.OrderLine"> --- 502,506 ---- </class></pre><p>Even ternary (or quaternary, etc) associations are possible:</p><pre class="programlisting"><class name="eg.Order" .... > .... ! <set name="purchasedItems" lazy="true"> <key name="order_id"> <composite-element class="eg.OrderLine"> *************** *** 623,627 **** Actually it is an alternative to the <tt>column</tt> attribute everywhere. A collection with elements of type <tt>Foo</tt> would use: ! </p><pre class="programlisting"><set role="foos"> <key column="owner_id"/> <many-to-many class="eg.Foo"> --- 552,556 ---- Actually it is an alternative to the <tt>column</tt> attribute everywhere. A collection with elements of type <tt>Foo</tt> would use: ! </p><pre class="programlisting"><set name="foos"> <key column="owner_id"/> <many-to-many class="eg.Foo"> *************** *** 638,642 **** .... .... ! <set role="Dates" lazy="true"> <key> <!-- a nested collection inherits the composite key type --> <column name="foo_string"/> --- 567,571 ---- .... .... ! <set name="Dates" lazy="true"> <key> <!-- a nested collection inherits the composite key type --> <column name="foo_string"/> *************** *** 646,650 **** <element column="foo_date" type="date"/> </set> ! </class></pre></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s3"></a>Cache</h2></div></div><p> A Hibernate <tt>Session</tt> is a transaction-level cache of persistent data. It is possible to configure a <tt>SessionFactory</tt>-level cache on a class-by-class --- 575,591 ---- <element column="foo_date" type="date"/> </set> ! </class></pre></div><div class="sect2"><div class="titlepage"><div><h3 class="title"><a name="adv-or-mapping-s2-4"></a>Dynabean components</h3></div></div><p> ! You may even map a property of type <tt>DynaBean</tt>: ! </p><pre class="programlisting"><dynabean name="userAttributes" dynaclass="UserAttributes"> ! <property name="foo" column="FOO"/> ! <property name="bar" column="BAR"/> ! <many-to-one name="baz" class="eg.Baz" column="BAZ"/> ! </dynabean></pre><p> ! The semantics of a <tt><dynabean></tt> mapping are identical ! to <tt><component></tt>. The advantage of this kind of mapping ! is the ability to determine the actual properties of the bean at deployment time ! by editting the mapping document. (Runtime manipulation of the mapping document ! is also possible, using a DOM parser.) ! </p></div></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="adv-or-mapping-s3"></a>Cache</h2></div></div><p> A Hibernate <tt>Session</tt> is a transaction-level cache of persistent data. It is possible to configure a <tt>SessionFactory</tt>-level cache on a class-by-class *************** *** 676,680 **** or where serializable transaction isolation level is needed. If the cache is used in a JTA environment, you must specify the property ! <tt>hibernate.transaction.manager_class</tt>, naming a strategy for obtaining the JTA <tt>TransactionManager</tt>. In other environments, you should ensure that the transaction is completed when <tt>Session.close()</tt> or --- 617,621 ---- or where serializable transaction isolation level is needed. If the cache is used in a JTA environment, you must specify the property ! <tt>hibernate.transaction.manager_lookup_class</tt>, naming a strategy for obtaining the JTA <tt>TransactionManager</tt>. In other environments, you should ensure that the transaction is completed when <tt>Session.close()</tt> or *************** *** 683,687 **** <jcs-cache usage="read-write"/> .... ! <set role="kittens" ... > <jcs-cache usage="read-write"/> .... --- 624,628 ---- <jcs-cache usage="read-write"/> .... ! <set name="kittens" ... > <jcs-cache usage="read-write"/> .... Index: architecture.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/architecture.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** architecture.html 1 Jan 2003 13:43:03 -0000 1.1.1.1 --- architecture.html 28 Jan 2003 13:25:09 -0000 1.2 *************** *** 18,30 **** Heres some definitions of the objects in the diagrams: </p><div class="itemizedlist"><ul type="disc"><li><p> ! <tt>cirrus.hibernate.SessionFactory</tt> </p></li><li><p> ! <tt>cirrus.hibernate.Session</tt> </p></li><li><p> ! <tt>cirrus.hibernate.Transaction</tt> </p></li><li><p> ! <tt>cirrus.hibernate.TransactionFactory</tt> </p></li><li><p> ! <tt>cirrus.hibernate.connection.ConnectionProvider</tt> </p></li><li><p> persistent objects and collections --- 18,30 ---- Heres some definitions of the objects in the diagrams: </p><div class="itemizedlist"><ul type="disc"><li><p> ! <tt>net.sf.hibernate.SessionFactory</tt> </p></li><li><p> ! <tt>net.sf.hibernate.Session</tt> </p></li><li><p> ! <tt>net.sf.hibernate.Transaction</tt> </p></li><li><p> ! <tt>net.sf.hibernate.TransactionFactory</tt> </p></li><li><p> ! <tt>net.sf.hibernate.connection.ConnectionProvider</tt> </p></li><li><p> persistent objects and collections Index: best-practices.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/best-practices.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** best-practices.html 1 Jan 2003 13:43:04 -0000 1.1.1.1 --- best-practices.html 28 Jan 2003 13:25:09 -0000 1.2 *************** *** 27,36 **** Hibernate lets the application manage JDBC connections. This approach should be considered a last-resort. If you can't use the built-in connections providers, consider providing your ! own implementation of <tt>cirrus.hibernate.connection.ConnectionProvider</tt>. </p></dd><dt><span class="term">Consider using a custom type.</span></dt><dd><p> Suppose you have a Java type, say from some library, that needs to be persisted but doesn't provide the accessors needed to map it as a component. You should consider implementing ! <tt>cirrus.hibernate.UserType</tt>. This approach frees the application code from implementing transformations to / from a Hibernate type. </p></dd><dt><span class="term">Use hand-coded JDBC in bottlenecks.</span></dt><dd><p> --- 27,36 ---- Hibernate lets the application manage JDBC connections. This approach should be considered a last-resort. If you can't use the built-in connections providers, consider providing your ! own implementation of <tt>net.sf.hibernate.connection.ConnectionProvider</tt>. </p></dd><dt><span class="term">Consider using a custom type.</span></dt><dd><p> Suppose you have a Java type, say from some library, that needs to be persisted but doesn't provide the accessors needed to map it as a component. You should consider implementing ! <tt>net.sf.hibernate.UserType</tt>. This approach frees the application code from implementing transformations to / from a Hibernate type. </p></dd><dt><span class="term">Use hand-coded JDBC in bottlenecks.</span></dt><dd><p> Index: examples.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/examples.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** examples.html 1 Jan 2003 13:43:05 -0000 1.1.1.1 --- examples.html 28 Jan 2003 13:25:09 -0000 1.2 *************** *** 14,18 **** <id name="id"> <generator class="sequence"> ! <param>employer_id_seq</param> </generator> </id> --- 14,18 ---- <id name="id"> <generator class="sequence"> ! <param name="sequence">employer_id_seq</param> </generator> </id> *************** *** 24,28 **** <id name="id"> <generator class="sequence"> ! <param>employment_id_seq</param> </generator> </id> --- 24,28 ---- <id name="id"> <generator class="sequence"> ! <param name="sequence">employment_id_seq</param> </generator> </id> *************** *** 45,49 **** <id name="id"> <generator class="sequence"> ! <param>employee_id_seq</param> </generator> </id> --- 45,49 ---- <id name="id"> <generator class="sequence"> ! <param name="sequence">employee_id_seq</param> </generator> </id> *************** *** 107,111 **** <property name="title"/> ! <set role="authors" table="author_work"> <key column="work_id" not-null="true"/> <many-to-many class="Author" column="author_id" not-null="true"/> --- 107,111 ---- <property name="title"/> ! <set name="authors" table="author_work"> <key column="work_id" not-null="true"/> <many-to-many class="Author" column="author_id" not-null="true"/> *************** *** 132,136 **** <one-to-one name="person" constrained="true"/> ! <set role="works" table="author_work" readonly="true"> <key column="author_id"/> <many-to-many class="Work" column="work_id"/> --- 132,136 ---- <one-to-one name="person" constrained="true"/> ! <set name="works" table="author_work" readonly="true"> <key column="author_id"/> <many-to-many class="Work" column="work_id"/> *************** *** 200,204 **** </id> <property name="name"/> ! <set role="orders" readonly="true"> <key column="customer_id"/> <one-to-many class="Order"/> --- 200,204 ---- </id> <property name="name"/> ! <set name="orders" readonly="true"> <key column="customer_id"/> <one-to-many class="Order"/> *************** *** 212,216 **** <property name="date"/> <many-to-one name="customer" column="customer_id"/> ! <list role="lineItems" table="line_items"> <key column="order_id"/> <index column="line_number"/> --- 212,216 ---- <property name="date"/> <many-to-one name="customer" column="customer_id"/> ! <list name="lineItems" table="line_items"> <key column="order_id"/> <index column="line_number"/> Index: index.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/html/index.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** index.html 1 Jan 2003 13:43:05 -0000 1.1.1.1 --- index.html 28 Jan 2003 13:25:09 -0000 1.2 *************** *** 1,3 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Hibernate Reference Documentation</title><link rel="stylesheet" href="../style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.49"><link rel="home" href="index.html" title="Hibernate Reference Documentation"><link rel="next" href="architecture.html" title="Chapter 1. Architecture"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Hibernate Reference Documentation</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="architecture.html">Next</a></td></tr></table><hr></div><div class="book"><div class="titlepage"><div><h1 class="title"><a name="d0e1"></a>Hibernate Reference Documentation</h1></div><div><h2 class="subtitle">Relational Persistence for Idiomatic Java</h2></div><div><h2 class="subtitle">http://hibernate.sourceforge.net/</h2></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="architecture.html">Architecture</a></dt><dd><dl><dt><a href="architecture.html#architecture-s1">Overview</a></dt><dt><a href="architecture.html#architecture-s2">Persistent Object Identity</a></dt><dt><a href="architecture.html#architecture-s3">JMX Integration</a></dt></dl></dd><dt>2. <a href="session-configuration.html">SessionFactory Configuration</a></dt><dd><dl><dt><a href="session-configuration.html#session-configuration-s1">Programmatic Datastore Configuration</a></dt><dt><a href="session-configuration.html#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt><a href="session-configuration.html#session-configuration-s3">User provided JDBC connection</a></dt><dt><a href="session-configuration.html#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt><a href="session-configuration.html#session-configuration-s5">Other properties</a></dt><dt><a href="session-configuration.html#session-configuration-s6">XML Configuration File</a></dt><dt><a href="session-configuration.html#session-configuration-s7">Logging</a></dt></dl></dd><dt>3. <a href="persistent-classes.html">Persistent Classes</a></dt><dd><dl><dt><a href="persistent-classes.html#persistent-classes-s1">Simple Example</a></dt><dd><dl><dt><a href="persistent-classes.html#persistent-classes-s1-1">Declare accessors and mutators for persistent fields</a></dt><dt><a href="persistent-classes.html#persistent-classes-s1-2">Implement a default constructor</a></dt><dt><a href="persistent-classes.html#persistent-classes-s1-3">Provide an identifier property (optional)</a></dt></dl></dd><dt><a href="persistent-classes.html#persistent-classes-s2">Inheritance</a></dt><dt><a href="persistent-classes.html#persistent-classes-s3">Persistent Lifecycle Callbacks</a></dt><dt><a href="persistent-classes.html#persistent-classes-s4">Validatable</a></dt></dl></dd><dt>4. <a href="or-mapping.html">Basic O/R Mapping</a></dt><dd><dl><dt><a href="or-mapping.html#or-mapping-s1">Mapping declaration</a></dt><dd><dl><dt><a href="or-mapping.html#or-mapping-s1-1">Doctype</a></dt><dt><a href="or-mapping.html#or-mapping-s1-2">hibernate-mapping</a></dt><dt><a href="or-mapping.html#or-mapping-s1-3">class</a></dt><dt><a href="or-mapping.html#or-mapping-s1-4">id</a></dt><dt><a href="or-mapping.html#or-mapping-s1-4b">composite-id</a></dt><dt><a href="or-mapping.html#or-mapping-s1-5">discriminator</a></dt><dt><a href="or-mapping.html#or-mapping-s1-6">version (optional)</a></dt><dt><a href="or-mapping.html#or-mapping-s1-6b">timestamp (optional)</a></dt><dt><a href="or-mapping.html#or-mapping-s1-7">property</a></dt><dt><a href="or-mapping.html#or-mapping-s1-8">many-to-one</a></dt><dt><a href="or-mapping.html#or-mapping-s1-9">one-to-one</a></dt><dt><a href="or-mapping.html#or-mapping-s1-10">component</a></dt><dt><a href="or-mapping.html#or-mapping-s1-11">subclass</a></dt><dt><a href="or-mapping.html#or-mapping-s1-11b">joined-subclass</a></dt><dt><a href="or-mapping.html#or-mapping-s1-12">map, set, list, bag</a></dt></dl></dd><dt><a href="or-mapping.html#or-mapping-s2">Hibernate Types</a></dt><dd><dl><dt><a href="or-mapping.html#or-mapping-s2-1">Entities and values</a></dt><dt><a href="or-mapping.html#or-mapping-s2-2">Basic value types</a></dt><dt><a href="or-mapping.html#or-mapping-s2-3">Persistent enum types</a></dt><dt><a href="or-mapping.html#or-mapping-s2-4">Custom value types</a></dt><dt><a href="or-mapping.html#or-mapping-s2-5">The object type</a></dt></dl></dd></dl></dd><dt>5. <a href="adv-or-mapping.html">Advanced O/R Mapping</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s2">Components</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-2">In Collections</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-1">Mapping</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt><a href="adv-or-mapping.html#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt><a href="adv-or-mapping.html#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></dd><dt>6. <a href="manipulating-data.html">Manipulating Persistent Data</a></dt><dd><dl><dt><a href="manipulating-data.html#manipulating-data-s1">Creating a persistent object</a></dt><dt><a href="manipulating-data.html#manipulating-data-s2">Loading an object</a></dt><dt><a href="manipulating-data.html#manipulating-data-s3">Querying</a></dt><dd><dl><dt><a href="manipulating-data.html#manipulating-data-s4">Scalar queries</a></dt><dt><a href="manipulating-data.html#manipulating-data-s5">The Query interface</a></dt><dt><a href="manipulating-data.html#manipulating-data-s5b">Scrollable iteration</a></dt><dt><a href="manipulating-data.html#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt><a href="manipulating-data.html#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt><a href="manipulating-data.html#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt><a href="manipulating-data.html#manipulating-data-s9">Deleting persistent objects</a></dt><dt><a href="manipulating-data.html#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt><a href="manipulating-data.html#manipulating-data-s11a">Lifecycle objects</a></dt><dt><a href="manipulating-data.html#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt><a href="manipulating-data.html#manipulating-data-s12">Flushing</a></dt><dt><a href="manipulating-data.html#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt><a href="manipulating-data.html#manipulating-data-s13-1">Flushing the session</a></dt><dt><a href="manipulating-data.html#manipulating-data-s13-2">Committing the transaction</a></dt><dt><a href="manipulating-data.html#manipulating-data-s13-3">Closing the session</a></dt><dt><a href="manipulating-data.html#manipulating-data-s13-4">Exception handling</a></dt></dl></dd><dt><a href="manipulating-data.html#manipulating-data-s14">Interceptors</a></dt></dl></dd><dt>7. <a href="query-language.html">Hibernate Query Language</a></dt><dd><dl><dt><a href="query-language.html#query-language-s1">Case Sensitivity</a></dt><dt><a href="query-language.html#query-language-s2">The from clause</a></dt><dt><a href="query-language.html#query-language-s3">The select c... [truncated message content] |