git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@5620 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Christian Bauer 2005-02-08 15:06:11 +00:00
parent e6de46feda
commit 02ac84b8e5
1 changed files with 22 additions and 1 deletions

View File

@ -208,9 +208,30 @@ END updatePerson;]]></programlisting>
</class>]]></programlisting>
<para>
TODO: Document synchronized mapping element in named queries
TODO: Document the following examples for collection loader and query-list
</para>
<programlisting><![CDATA[
<sql-query name="organizationEmployments">
<load-collection alias="empcol" role="Organization.employments"/>
SELECT {empcol.*}
FROM EMPLOYMENT empcol
WHERE EMPLOYER = :id
ORDER BY STARTDATE ASC, EMPLOYEE ASC
</sql-query>
<sql-query name="organizationCurrentEmployments">
<return alias="emp" class="Employment"/>
<synchronize table="EMPLOYMENT"/>
SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer},
STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},
REGIONCODE as {emp.regionCode}, ID AS {emp.id}
FROM EMPLOYMENT
WHERE EMPLOYER = :id AND ENDDATE IS NULL
ORDER BY STARTDATE ASC
</sql-query>
]]></programlisting>
</sect1>
</chapter>