Added an important little detail about non-inverse lists

git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@8624 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Christian Bauer 2005-11-19 19:14:57 +00:00
parent 1ebf3f95e5
commit e3c6fe2ba4
1 changed files with 10 additions and 1 deletions

View File

@ -294,7 +294,7 @@ create table Address ( addressId bigint not null primary key )
<sect1 id="assoc-bidirectional" revision="1">
<title>Bidirectional associations</title>
<sect2 id="assoc-bidirectional-m21" revision="1">
<sect2 id="assoc-bidirectional-m21" revision="2">
<title>one to many / many to one</title>
<para>
@ -355,6 +355,15 @@ create table Address ( addressId bigint not null primary key )
</list>
</class>]]></programlisting>
<para>
It is important that you define <literal>not-null="true"</literal> on the
<literal>&lt;key&gt;</literal> element of the collection mapping if the
underlying foreign key column is <literal>NOT NULL</literal>. Don't only
declare <literal>not-null="true"</literal> on a possible nested
<literal>&lt;column&gt;</literal> element, but on the <literal>&lt;key&gt;</literal>
element.
</para>
</sect2>
<sect2 id="assoc-bidirectional-121">