mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-12 06:04:49 +00:00
document fetch all properties
git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@6384 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
f882362299
commit
908eb5e324
@ -150,7 +150,7 @@ Integer accessLevel = (Integer) permissions.get("accounts"); // Error!]]></prog
|
||||
<para>
|
||||
Usually, we don't use the mapping document to customize fetching. Instead, we
|
||||
keep the default behavior, and override it for a particular transaction, using
|
||||
the HQL <literal>LEFT JOIN FETCH</literal> clause. This tells Hibernate to fetch
|
||||
<literal>left join fetch</literal> in HQL. This tells Hibernate to fetch
|
||||
the association eagerly in the first select, using an outer join. In the
|
||||
<literal>Criteria</literal> query API, you would use
|
||||
<literal>setFetchMode(FetchMode.JOIN)</literal>.
|
||||
@ -191,6 +191,11 @@ Integer accessLevel = (Integer) permissions.get("accounts"); // Error!]]></prog
|
||||
There are no restrictions to join fetching of single-ended associations.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A completely different way to avoid problems with N+1 selects is to use the
|
||||
second-level cache.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="performance-fetching-proxies" revision="2">
|
||||
@ -481,6 +486,11 @@ Cat fritz = (Cat) iter.next();]]></programlisting>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="performance-fetching-batch">
|
||||
<title>Using subselect fetching</title>
|
||||
<para>TODO</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="performance-fetching-lazyproperties">
|
||||
<title>Using lazy property fetching</title>
|
||||
|
||||
@ -537,14 +547,14 @@ Cat fritz = (Cat) iter.next();]]></programlisting>
|
||||
queries. This avoids the need for buildtime bytecode processing and is
|
||||
certainly a prefered solution.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You may force the usual eager fetching of properties using <literal>fetch all
|
||||
properties</literal> in HQL.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<para>
|
||||
A completely different way to avoid problems with N+1 selects is to use the second-level
|
||||
cache.
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="performance-cache" revision="1">
|
||||
|
Loading…
x
Reference in New Issue
Block a user