openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: @Dependent annotation vs cascade=ALL
Date Thu, 08 Mar 2007 17:40:27 GMT
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 <awhite@bea.com> 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:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message