HHH-2127 : document default filter conditions

git-svn-id: https://svn.jboss.org/repos/hibernate/branches/Branch_3_2/Hibernate3/doc@10705 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2006-11-03 13:38:40 +00:00
parent 002dafbe29
commit 908d22346f
1 changed files with 18 additions and 1 deletions

View File

@ -7,7 +7,7 @@
enabled or disabled for a particular Hibernate session.
</para>
<sect1 id="objectstate-filters">
<sect1 id="objectstate-filters" revision="1">
<title>Hibernate filters</title>
<para>
@ -123,6 +123,23 @@ List results = session.createQuery("from Employee as e where e.salary > :targetS
the operator.
</para>
<para>
After being defined a filter might be attached to multiple entities and/or
collections each with its own condition. That can be tedious when the
conditions are the same each time. Thus <literal>&lt;filter-def/&gt;</literal>
allows defining a default condition, either as an attribute or CDATA:
</para>
<programlisting><![CDATA[<filter-def name="myFilter" condition="abc > xyz">...</filter-def>
<filter-def name="myOtherFilter">abc=xyz</filter-def>]]></programlisting>
<para>
This default condition will then be used whenever the filter is attached to something
without specifying a condition. Note that this means you can give a specific condition
as part of the attachment of the filter which overrides the default condition in that
particular case.
</para>
</sect1>
</chapter>