docd str() and mod()

new example


git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@7089 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Gavin King 2005-06-08 18:34:40 +00:00
parent 5ae9192e1c
commit 15755384cd
2 changed files with 48 additions and 3 deletions

View File

@ -353,8 +353,8 @@ alter table line_items
<para>
These examples are all taken from the Hibernate test suite. You
will find many other useful example mappings there. Have a look at the
<literal>src</literal> folder of the Hibernate distribution.
will find many other useful example mappings there. Look in the
<literal>test</literal> folder of the Hibernate distribution.
</para>
<para>TODO: put words around this stuff</para>
@ -506,6 +506,45 @@ alter table line_items
</class>]]></programlisting>
</sect2>
<sect2 id="example-mappings-composite-key-manytomany">
<title>Many-to-many with shared composite key attribute</title>
<programlisting><![CDATA[<class name="User" table="`User`">
<composite-id>
<key-property name="name"/>
<key-property name="org"/>
</composite-id>
<set name="groups" table="UserGroup">
<key>
<column name="userName"/>
<column name="org"/>
</key>
<many-to-many class="Group">
<column name="groupName"/>
<formula>org</formula>
</many-to-many>
</set>
</class>
<class name="Group" table="`Group`">
<composite-id>
<key-property name="name"/>
<key-property name="org"/>
</composite-id>
<property name="description"/>
<set name="users" table="UserGroup" inverse="true">
<key>
<column name="groupName"/>
<column name="org"/>
</key>
<many-to-many class="User">
<column name="userName"/>
<formula>org</formula>
</many-to-many>
</set>
</class>
]]></programlisting>
</sect2>
<sect2 id="example-mappings-content-discrimination">
<title>Content based discrimination</title>
<programlisting><![CDATA[<class name="Person"

View File

@ -546,7 +546,7 @@ where log.item.class = 'Payment' and log.item.id = payment.id]]></programlisting
<listitem>
<para>
Any function or operator defined by EJB-QL 3.0: <literal>substring(), trim(),
lower(), upper(), length(), locate(), abs(), sqrt(), bit_length()</literal>
lower(), upper(), length(), locate(), abs(), sqrt(), bit_length(), mod()</literal>
</para>
</listitem>
<listitem>
@ -554,6 +554,12 @@ where log.item.class = 'Payment' and log.item.id = payment.id]]></programlisting
<literal>coalesce()</literal> and <literal>nullif()</literal>
</para>
</listitem>
<listitem>
<para>
<literal>str()</literal> for converting numeric or temporal values to a
readable string
</para>
</listitem>
<listitem>
<para>
<literal>cast(... as ...)</literal>, where the second argument is the name of