Finally remembered to integrate the doc changes for this conversation.  I
just put a couple of pointer references between the JPA
CascadeType.REMOVEand the OpenJPA @Dependent annotation sections.  SVN
revision #518192.

On 3/8/07, Craig L Russell <[EMAIL PROTECTED]> wrote:

Hi Kevin,

On Mar 8, 2007, at 8:45 AM, Kevin Sutter wrote:

> Abe,
> Your explanation in your reply was much clearer (IMHO) than the
> current
> documentation.  I will take a stab at improving the wording so that
> the
> meaning and differences are more pronounced.  I will also link the two
> sections of the document.  Thanks.
>
> One clarification...  Using Magazine and Article from the doc's
> example, if
> a field (Article) is marked as @Dependent and the owning object
> (Magazine)
> is deleted, then cascading this delete operation down to the
> Article object
> is the same as specifying cascade=REMOVE (or ALL) on the relationship
> annotation.  Correct?

Yes. From the perspective of the remove behavior, cascade=REMOVE or
@Dependent will have the same effect.

> It seems that the added benefit of the @Dependent
> family of annotations is to aid with the orphan object deletion
> when the
> Article field is just nulled out.

Right. Usually, dependent relationships are modeled as one-to-many
relationships, but they apply equally to single-valued relationships.
As far as I know, they have no value when used with many-to-
relationships, though.

Craig
>
> Thanks,
> Kevin
>
> On 3/8/07, Abe White <[EMAIL PROTECTED]> wrote:
>>
>> > Thanks, Abe.  This explanation helps a great deal.  Should we
>> > update the
>> > documentation with some of this information?
>>
>> As far as I can tell the documentation on cascade=DELETE and the
>> documentation on the Dependent metadata extension already contains
>> everything I said.  Feel free to change it, though.
>> _____________________________________________________________________
>> __
>> Notice:  This email message, together with any attachments, may
>> contain
>> information  of  BEA Systems,  Inc.,  its subsidiaries  and
>> affiliated
>> entities,  that may be confidential,  proprietary,  copyrighted
>> and/or
>> legally privileged, and is intended solely for the use of the
>> individual
>> or entity named in this message. If you are not the intended
>> recipient,
>> and have received this message in error, please immediately return
>> this
>> by email and then delete it.
>>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!



Reply via email to