From: <tu...@us...> - 2002-11-26 08:15:00
|
Update of /cvsroot/hibernate/Hibernate/doc/reference/html_single In directory sc8-pr-cvs1:/tmp/cvs-serv32325/doc/reference/html_single Modified Files: index.html Log Message: Update to current and CSS quotation fix Index: index.html =================================================================== RCS file: /cvsroot/hibernate/Hibernate/doc/reference/html_single/index.html,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** index.html 25 Nov 2002 21:01:40 -0000 1.86 --- index.html 26 Nov 2002 08:14:57 -0000 1.87 *************** *** 1,5 **** <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"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><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">Architecture</a></dt><dd><dl><dt><a href="#architecture-s1">Overview</a></dt><dt><a href="#architecture-s2">Persistent Object Identity</a></dt><dt><a href="#architecture-s3">JMX Integration</a></dt></dl></dd><dt>2. <a href="#session-configuration">SessionFactory Configuration</a></dt><dd><dl><dt><a href="#session-configuration-s1">Programmatic Datastore Configuration</a></dt><dt><a href="#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt><a href="#session-configuration-s3">User provided JDBC connection</a></dt><dt><a href="#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt><a href="#session-configuration-s5">Other properties</a></dt><dt><a href="#session-configuration-s6">XML Configuration File</a></dt><dt><a href="#session-configuration-s7">Logging</a></dt></dl></dd><dt>3. <a href="#persistent-classes">Persistent Classes</a></dt><dd><dl><dt><a href="#persistent-classes-s1">Simple Example</a></dt><dd><dl><dt><a href="#persistent-classes-s1-1">Declare accessors and mutators for persistent fields</a></dt><dt><a href="#persistent-classes-s1-2">Implement a default constructor</a></dt><dt><a href="#persistent-classes-s1-3">Provide an identifier property (optional)</a></dt></dl></dd><dt><a href="#persistent-classes-s2">Inheritance</a></dt><dt><a href="#persistent-classes-s3">Persistent Lifecycle Callbacks</a></dt><dt><a href="#persistent-classes-s4">Validatable</a></dt></dl></dd><dt>4. <a href="#or-mapping">Basic O/R Mapping</a></dt><dd><dl><dt><a href="#or-mapping-s1">Mapping declaration</a></dt><dd><dl><dt><a href="#or-mapping-s1-1">Doctype</a></dt><dt><a href="#or-mapping-s1-2">hibernate-mapping</a></dt><dt><a href="#or-mapping-s1-3">class</a></dt><dt><a href="#or-mapping-s1-4">id</a></dt><dt><a href="#or-mapping-s1-4b">composite-id</a></dt><dt><a href="#or-mapping-s1-5">discriminator</a></dt><dt><a href="#or-mapping-s1-6">version (optional)</a></dt><dt><a href="#or-mapping-s1-6b">timestamp (optional)</a></dt><dt><a href="#or-mapping-s1-7">property</a></dt><dt><a href="#or-mapping-s1-8">many-to-one</a></dt><dt><a href="#or-mapping-s1-9">one-to-one</a></dt><dt><a href="#or-mapping-s1-10">component</a></dt><dt><a href="#or-mapping-s1-11">subclass</a></dt><dt><a href="#or-mapping-s1-11b">joined-subclass</a></dt><dt><a href="#or-mapping-s1-12">map, set, list, bag</a></dt></dl></dd><dt><a href="#or-mapping-s2">Hibernate Types</a></dt><dd><dl><dt><a href="#or-mapping-s2-1">Entities and values</a></dt><dt><a href="#or-mapping-s2-2">Basic value types</a></dt><dt><a href="#or-mapping-s2-3">Persistent enum types</a></dt><dt><a href="#or-mapping-s2-4">Custom value types</a></dt><dt><a href="#or-mapping-s2-5">The object type</a></dt></dl></dd></dl></dd><dt>5. <a href="#adv-or-mapping">Advanced O/R Mapping</a></dt><dd><dl><dt><a href="#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt><a href="#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt><a href="#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt><a href="#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt><a href="#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt><a href="#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt><a href="#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt><a href="#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt><a href="#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt><a href="#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt><a href="#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt><a href="#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt><a href="#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt><a href="#adv-or-mapping-s2">Components</a></dt><dd><dl><dt><a href="#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt><a href="#adv-or-mapping-s2-2">In Collections</a></dt><dt><a href="#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt><a href="#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt><a href="#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt><a href="#adv-or-mapping-s3-1">Mapping</a></dt><dt><a href="#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt><a href="#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt><a href="#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></dd><dt>6. <a href="#manipulating-data">Manipulating Persistent Data</a></dt><dd><dl><dt><a href="#manipulating-data-s1">Creating a persistent object</a></dt><dt><a href="#manipulating-data-s2">Loading an object</a></dt><dt><a href="#manipulating-data-s3">Querying</a></dt><dd><dl><dt><a href="#manipulating-data-s4">Scalar queries</a></dt><dt><a href="#manipulating-data-s5">The Query interface</a></dt><dt><a href="#manipulating-data-s5b">Scrollable iteration</a></dt><dt><a href="#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt><a href="#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt><a href="#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt><a href="#manipulating-data-s9">Deleting persistent objects</a></dt><dt><a href="#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt><a href="#manipulating-data-s11a">Lifecycle objects</a></dt><dt><a href="#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt><a href="#manipulating-data-s12">Flushing</a></dt><dt><a href="#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt><a href="#manipulating-data-s13-1">Flushing the session</a></dt><dt><a href="#manipulating-data-s13-2">Committing the transaction</a></dt><dt><a href="#manipulating-data-s13-3">Closing the session</a></dt><dt><a href="#manipulating-data-s13-4">Exception handling</a></dt></dl></dd><dt><a href="#manipulating-data-s14">Interceptors</a></dt></dl></dd><dt>7. <a href="#query-language">Hibernate Query Language</a></dt><dd><dl><dt><a href="#query-language-s1">Case Sensitivity</a></dt><dt><a href="#query-language-s2">The from clause</a></dt><dt><a href="#query-language-s3">The select clause</a></dt><dt><a href="#query-language-s3b">polymorphism</a></dt><dt><a href="#query-language-s4">from collections</a></dt><dt><a href="#query-language-s5">The where clause</a></dt><dt><a href="#query-language-s6">Expressions</a></dt><dt><a href="#query-language-s7">The order by clause</a></dt><dt><a href="#query-language-s8">The group by clause</a></dt><dt><a href="#query-language-s9">Subqueries</a></dt></dl></dd><dt>8. <a href="#transactions">Transactions And Concurrency</a></dt><dd><dl><dt><a href="#transactions-s1">Datastores, Sessions and Factories</a></dt><dt><a href="#transactions-s2">Threads and connections</a></dt><dt><a href="#transactions-s3">Optimistic Locking / Versioning</a></dt><dd><dl><dt><a href="#transactions-s3-1">Long session with automatic versioning</a></dt><dt><a href="#transactions-s3-2">Many sessions with automatic versioning</a></dt><dt><a href="#transactions-s3-3">Application version checking</a></dt></dl></dd><dt><a href="#transactions-s4">Session disconnection</a></dt><dt><a href="#transactions-s5">Pessimistic Locking</a></dt></dl></dd><dt>9. <a href="#examples">Examples</a></dt><dd><dl><dt><a href="#examples-s0">Employer / Employee</a></dt><dt><a href="#examples-s1">Author / Work</a></dt><dt><a href="#examples-s2">Customer / Order / Product</a></dt></dl></dd><dt>10. <a href="#best-practices">Best Practices</a></dt></dl></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="architecture"></a>Chapter 1. Architecture</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#architecture-s1">Overview</a></dt><dt><a href="#architecture-s2">Persistent Object Identity</a></dt><dt><a href="#architecture-s3">JMX Integration</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="architecture-s1"></a>Overview</h2></div></div><p> A (very) high-level view of the Hibernate architecture: </p><div class="mediaobject"><img src="../images/overview.gif" align="center"></div><p> --- 1,5 ---- <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"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><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">Architecture</a></dt><dd><dl><dt><a href="#architecture-s1">Overview</a></dt><dt><a href="#architecture-s2">Persistent Object Identity</a></dt><dt><a href="#architecture-s3">JMX Integration</a></dt></dl></dd><dt>2. <a href="#session-configuration">SessionFactory Configuration</a></dt><dd><dl><dt><a href="#session-configuration-s1">Programmatic Datastore Configuration</a></dt><dt><a href="#session-configuration-s2">Obtaining a SessionFactory</a></dt><dt><a href="#session-configuration-s3">User provided JDBC connection</a></dt><dt><a href="#session-configuration-s4">Hibernate provided JDBC connection</a></dt><dt><a href="#session-configuration-s5">Other properties</a></dt><dt><a href="#session-configuration-s6">XML Configuration File</a></dt><dt><a href="#session-configuration-s7">Logging</a></dt></dl></dd><dt>3. <a href="#persistent-classes">Persistent Classes</a></dt><dd><dl><dt><a href="#persistent-classes-s1">Simple Example</a></dt><dd><dl><dt><a href="#persistent-classes-s1-1">Declare accessors and mutators for persistent fields</a></dt><dt><a href="#persistent-classes-s1-2">Implement a default constructor</a></dt><dt><a href="#persistent-classes-s1-3">Provide an identifier property (optional)</a></dt></dl></dd><dt><a href="#persistent-classes-s2">Inheritance</a></dt><dt><a href="#persistent-classes-s3">Persistent Lifecycle Callbacks</a></dt><dt><a href="#persistent-classes-s4">Validatable</a></dt></dl></dd><dt>4. <a href="#or-mapping">Basic O/R Mapping</a></dt><dd><dl><dt><a href="#or-mapping-s1">Mapping declaration</a></dt><dd><dl><dt><a href="#or-mapping-s1-1">Doctype</a></dt><dt><a href="#or-mapping-s1-2">hibernate-mapping</a></dt><dt><a href="#or-mapping-s1-3">class</a></dt><dt><a href="#or-mapping-s1-4">id</a></dt><dt><a href="#or-mapping-s1-4b">composite-id</a></dt><dt><a href="#or-mapping-s1-5">discriminator</a></dt><dt><a href="#or-mapping-s1-6">version (optional)</a></dt><dt><a href="#or-mapping-s1-6b">timestamp (optional)</a></dt><dt><a href="#or-mapping-s1-7">property</a></dt><dt><a href="#or-mapping-s1-8">many-to-one</a></dt><dt><a href="#or-mapping-s1-9">one-to-one</a></dt><dt><a href="#or-mapping-s1-10">component</a></dt><dt><a href="#or-mapping-s1-11">subclass</a></dt><dt><a href="#or-mapping-s1-11b">joined-subclass</a></dt><dt><a href="#or-mapping-s1-12">map, set, list, bag</a></dt></dl></dd><dt><a href="#or-mapping-s2">Hibernate Types</a></dt><dd><dl><dt><a href="#or-mapping-s2-1">Entities and values</a></dt><dt><a href="#or-mapping-s2-2">Basic value types</a></dt><dt><a href="#or-mapping-s2-3">Persistent enum types</a></dt><dt><a href="#or-mapping-s2-4">Custom value types</a></dt><dt><a href="#or-mapping-s2-5">The object type</a></dt></dl></dd></dl></dd><dt>5. <a href="#adv-or-mapping">Advanced O/R Mapping</a></dt><dd><dl><dt><a href="#adv-or-mapping-s1">Collections</a></dt><dd><dl><dt><a href="#adv-or-mapping-s1-1">Persistent Collection Styles</a></dt><dt><a href="#adv-or-mapping-s1-2">Toplevel and Nested Collections</a></dt><dt><a href="#adv-or-mapping-s1-3">Mapping a Collection</a></dt><dt><a href="#adv-or-mapping-s1-4">Mapping a Property to a Toplevel Collection</a></dt><dt><a href="#adv-or-mapping-s1-5">Collections of Values and Many To Many Associations</a></dt><dt><a href="#adv-or-mapping-s1-6">One To Many Associations</a></dt><dt><a href="#adv-or-mapping-s1-7">Lazy Initialization</a></dt><dt><a href="#adv-or-mapping-s1-8">Sorted Collections</a></dt><dt><a href="#adv-or-mapping-s1-9">Garbage Collection</a></dt><dt><a href="#adv-or-mapping-s1-10">Bidirectional Associations</a></dt><dt><a href="#adv-or-mapping-s1-11">Ternary Associations</a></dt><dt><a href="#adv-or-mapping-s1-12">Collection Example</a></dt></dl></dd><dt><a href="#adv-or-mapping-s2">Components</a></dt><dd><dl><dt><a href="#adv-or-mapping-s2-1">As Dependent Objects</a></dt><dt><a href="#adv-or-mapping-s2-2">In Collections</a></dt><dt><a href="#adv-or-mapping-s2-2b">As a Map Index</a></dt><dt><a href="#adv-or-mapping-s2-3">As Composite Identifiers</a></dt></dl></dd><dt><a href="#adv-or-mapping-s3">Cache</a></dt><dd><dl><dt><a href="#adv-or-mapping-s3-1">Mapping</a></dt><dt><a href="#adv-or-mapping-s3-2">Read Only Cache</a></dt><dt><a href="#adv-or-mapping-s3-3">Read / Write Cache</a></dt></dl></dd><dt><a href="#adv-or-mapping-s4">Proxies for Lazy Initialization</a></dt></dl></dd><dt>6. <a href="#manipulating-data">Manipulating Persistent Data</a></dt><dd><dl><dt><a href="#manipulating-data-s1">Creating a persistent object</a></dt><dt><a href="#manipulating-data-s2">Loading an object</a></dt><dt><a href="#manipulating-data-s3">Querying</a></dt><dd><dl><dt><a href="#manipulating-data-s4">Scalar queries</a></dt><dt><a href="#manipulating-data-s5">The Query interface</a></dt><dt><a href="#manipulating-data-s5b">Scrollable iteration</a></dt><dt><a href="#manipulating-data-s6">Filtering collections</a></dt></dl></dd><dt><a href="#manipulating-data-s7">Updating objects saved or loaded in the current session</a></dt><dt><a href="#manipulating-data-s8">Updating objects saved or loaded in a previous session</a></dt><dt><a href="#manipulating-data-s9">Deleting persistent objects</a></dt><dt><a href="#manipulating-data-s10">Graphs of objects</a></dt><dd><dl><dt><a href="#manipulating-data-s11a">Lifecycle objects</a></dt><dt><a href="#manipulating-data-s11b">Persistence by Reachability</a></dt></dl></dd><dt><a href="#manipulating-data-s12">Flushing</a></dt><dt><a href="#manipulating-data-s13">Ending a Session</a></dt><dd><dl><dt><a href="#manipulating-data-s13-1">Flushing the session</a></dt><dt><a href="#manipulating-data-s13-2">Committing the transaction</a></dt><dt><a href="#manipulating-data-s13-3">Closing the session</a></dt><dt><a href="#manipulating-data-s13-4">Exception handling</a></dt></dl></dd><dt><a href="#manipulating-data-s14">Interceptors</a></dt></dl></dd><dt>7. <a href="#query-language">Hibernate Query Language</a></dt><dd><dl><dt><a href="#query-language-s1">Case Sensitivity</a></dt><dt><a href="#query-language-s2">The from clause</a></dt><dt><a href="#query-language-s3">The select clause</a></dt><dt><a href="#query-language-s3b">polymorphism</a></dt><dt><a href="#query-language-s4">from collections</a></dt><dt><a href="#query-language-s5">The where clause</a></dt><dt><a href="#query-language-s6">Expressions</a></dt><dt><a href="#query-language-s7">The order by clause</a></dt><dt><a href="#query-language-s8">The group by clause</a></dt><dt><a href="#query-language-s9">Subqueries</a></dt></dl></dd><dt>8. <a href="#transactions">Transactions And Concurrency</a></dt><dd><dl><dt><a href="#transactions-s1">Datastores, Sessions and Factories</a></dt><dt><a href="#transactions-s2">Threads and connections</a></dt><dt><a href="#transactions-s3">Optimistic Locking / Versioning</a></dt><dd><dl><dt><a href="#transactions-s3-1">Long session with automatic versioning</a></dt><dt><a href="#transactions-s3-2">Many sessions with automatic versioning</a></dt><dt><a href="#transactions-s3-3">Application version checking</a></dt></dl></dd><dt><a href="#transactions-s4">Session disconnection</a></dt><dt><a href="#transactions-s5">Pessimistic Locking</a></dt></dl></dd><dt>9. <a href="#examples">Examples</a></dt><dd><dl><dt><a href="#examples-s0">Employer / Employee</a></dt><dt><a href="#examples-s1">Author / Work</a></dt><dt><a href="#examples-s2">Customer / Order / Product</a></dt></dl></dd><dt>10. <a href="#best-practices">Best Practices</a></dt></dl></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="architecture"></a>Chapter 1. Architecture</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#architecture-s1">Overview</a></dt><dt><a href="#architecture-s2">Persistent Object Identity</a></dt><dt><a href="#architecture-s3">JMX Integration</a></dt></dl></div><div class="sect1"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="architecture-s1"></a>Overview</h2></div></div><p> A (very) high-level view of the Hibernate architecture: </p><div class="mediaobject"><img src="../images/overview.gif" align="center"></div><p> *************** *** 242,246 **** certain platform dependent features</td></tr><tr><td><tt>hibernate.default_schema</tt></td><td><tt>SCHEMA_NAME</tt></td><td>qualify unqualified tablenames with the given schema / tablespace in generated SQL</td></tr><tr><td><tt>hibernate.session_factory_name</tt></td><td><tt>jndi/composite/name</tt></td><td>bind this name to the <tt>SessionFactory</tt></td></tr><tr><td><tt>hibernate.use_outer_join</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>enables <span class="emphasis"><i>outer join fetching</i></span></td></tr><tr><td><tt>hibernate.jdbc.fetch_size</tt></td><td> </td><td>a non-zero value determines the JDBC fetch size ( calls ! <tt>Statement.setFetchSize()</tt> )</td></tr><tr><td><tt>hibernate.jdbc.batch_size</tt></td><td>recommended values between 5 and 30</td><td>a nonzero value enables use of JDBC2 batch updates by Hibernate</td></tr><tr><td><tt>hibernate.jdbc.use_scrollable_resultsets</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>enables use of JDBC2 scrollable resultsets by Hibernate. This property is only necessary when using user supplied connections. Hibernate uses connection metadata otherwise.</td></tr><tr><td><tt>hibernate.jdbc.use_streams_for_binary</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>use streams when writing / reading <tt>binary</tt> --- 242,246 ---- certain platform dependent features</td></tr><tr><td><tt>hibernate.default_schema</tt></td><td><tt>SCHEMA_NAME</tt></td><td>qualify unqualified tablenames with the given schema / tablespace in generated SQL</td></tr><tr><td><tt>hibernate.session_factory_name</tt></td><td><tt>jndi/composite/name</tt></td><td>bind this name to the <tt>SessionFactory</tt></td></tr><tr><td><tt>hibernate.use_outer_join</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>enables <span class="emphasis"><i>outer join fetching</i></span></td></tr><tr><td><tt>hibernate.jdbc.fetch_size</tt></td><td> </td><td>a non-zero value determines the JDBC fetch size ( calls ! <tt>Statement.setFetchSize()</tt> )</td></tr><tr><td><tt>hibernate.jdbc.batch_size</tt></td><td>recommended values between 5 and 30</td><td>a nonzero value enables use of JDBC2 batch updates by Hibernate</td></tr><tr><td><tt>hibernate.jdbc.use_scrollable_resultset</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>enables use of JDBC2 scrollable resultsets by Hibernate. This property is only necessary when using user supplied connections. Hibernate uses connection metadata otherwise.</td></tr><tr><td><tt>hibernate.jdbc.use_streams_for_binary</tt></td><td><tt>true</tt> | <tt>false</tt></td><td>use streams when writing / reading <tt>binary</tt> |