Skip to content

Commit 58ddd3b

Browse files
mickfoldmickfold
authored andcommitted
Update to docs for addition of one-to-one cascade delete orphan functionality
1 parent 635da76 commit 58ddd3b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

doc/reference/modules/basic_mapping.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@
14251425
name="PropertyName"
14261426
column="column_name"
14271427
class="ClassName"
1428-
cascade="all|none|save-update|delete"
1428+
cascade="all|none|save-update|delete|delete-orphan|all-delete-orphan"
14291429
fetch="join|select"
14301430
update="true|false"
14311431
insert="true|false"
@@ -1585,7 +1585,7 @@
15851585
<programlisting><![CDATA[<one-to-one
15861586
name="PropertyName"
15871587
class="ClassName"
1588-
cascade="all|none|save-update|delete"
1588+
cascade="all|none|save-update|delete|delete-orphan|all-delete-orphan"
15891589
constrained="true|false"
15901590
fetch="join|select"
15911591
property-ref="PropertyNameFromAssociatedClass"

doc/reference/modules/manipulating_data.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,14 +1043,15 @@ finally
10431043
</itemizedlist>
10441044

10451045
<para>
1046-
Mapping an association (many-to-one, or collection) with <literal>cascade="all"</literal>
1046+
Mapping an association (many-to-one, one-to-one or collection) with <literal>cascade="all"</literal>
10471047
marks the association as a <emphasis>parent/child</emphasis> style relationship where
10481048
save/update/deletion of the parent results in save/update/deletion of the child(ren).
10491049
Futhermore, a mere reference to a child from a persistent parent will result in save / update
10501050
of the child. The metaphor is incomplete, however. A child which becomes unreferenced by its
1051-
parent is <emphasis>not</emphasis> automatically deleted, except in the case of a
1052-
<literal>&lt;one-to-many&gt;</literal> association mapped with
1053-
<literal>cascade="all-delete-orphan"</literal>. The precise semantics of cascading operations
1051+
parent is <emphasis>not</emphasis> automatically deleted, except in the cases of
1052+
<literal>&lt;one-to-many&gt;</literal> and <literal>&lt;one-to-one&gt;</literal> associations
1053+
that have been mapped with <literal>cascade="all-delete-orphan"</literal> or
1054+
<literal>cascade="delete-orphan"</literal>. The precise semantics of cascading operations
10541055
are as follows:
10551056
</para>
10561057

@@ -1081,8 +1082,8 @@ finally
10811082
<para>
10821083
If a transient child is dereferenced by a persistent parent, <emphasis>nothing
10831084
special happens</emphasis> (the application should explicitly delete the child if
1084-
necessary) unless <literal>cascade="all-delete-orphan"</literal>, in which case the
1085-
"orphaned" child is deleted.
1085+
necessary) unless <literal>cascade="all-delete-orphan"</literal> or
1086+
<literal>cascade="delete-orphan"</literal>, in which case the "orphaned" child is deleted.
10861087
</para>
10871088
</listitem>
10881089
</itemizedlist>

0 commit comments

Comments
 (0)