Re: Owns destination and other relationship constraints ...

Ashley Aitken <[email protected]> Fri, 16 Apr 2004 22:43:33 +0800
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Hi Jean-Francois,

Thanks for your post.

On 15/04/2004, at 8:11 AM, Jean-François Veillette wrote:
>> 1.  How does one move an object from one aggregate to another?  Does 
>> it just work, to remove it from one aggregate and add it to another, 
>> for example, in code, or will this cause a problem.
>
> it's actually not deleted until you do saveChanges.
> so yes, you can remove from one relationship, add to another, then do 
> saveChanges.

That's good to know, and as I suspected (and hoped).

>> 2.  If you have a relationship set as "owns destination" *must* the 
>> reverse relationship be mandatory and cascade or deny delete?  
>> Optional and nullify or no-action sound problematic.
>
> no, it "must" not be mandatory,  but it certainly make sense that it 
> be, but no obligation.

So you are saying it doesn't have to be mandatory.

Ok, so for 'Project has (owned) Jobs'  - a Job not in the owned 
relationship is ok.  Owned just means that if it is in the 
relationship, when it is removed it will (or should, or can) be deleted 
automatically by EOF?

> I doubt the reverse relationship should ever be cascade.  but that's 
> your business model, it can be whatever your business model is.

Yes, sorry, that was poorly worded (it was late, see my previous 
email).  I was talking about the "owned" relationship being cascade or 
deny (now, not allowed it seems) - not the reverse relationship.

Cheers,
Ashley.


--
Ashley Aitken
Perth, Western Australia
mrhatken at mac dot com