Re: refresh an enterprise object
Re: refresh an enterprise object
- Subject: Re: refresh an enterprise object
- From: Nathan Dumar <email@hidden>
- Date: Mon, 21 Jun 2004 21:58:40 -0400
I think aProduct is an EO. Are you sure
addObjectToBothSidesOfRelationshipWithKey is a method in an EO? I
haven't needed to use it yet, so I don't know much about it.
Because he said, "although data is inserted but the relationship is not
'declared' at this time," I thought he already had the objects, and
just needed to establish the relationship. Which to me would be the
initial setup in EOModeler or hooking the objects together in code --
either would prevent getting across the relationship. ... I may have
misunderstood Goh's question, though.
Nathan
On Jun 21, 2004, at 7:26 PM, Greg Hulands wrote:
shouldn't it be
aProduct.addObjectToBothSidesOfRelationshipWithKey(aStatusObject,
"status") ???
On 22/06/2004, at 9:07 AM, Nathan Dumar wrote:
If the relationship is set up correctly, you should be doing
something like:
// assuming a to-1
aProduct.setStatus(aStatusObject);
and if it's reciprocal,
// assuming a to-many
aStatusObject.setProducts(aStatusObject.products().arrayByAddingObject
(aProduct));
You shouldn't be setting the key yourself. Let WO figure that stuff
out -- just tell it which objects are related.
You won't be able to traverse a relationship that you have not yet
defined. Use EOModeler first to set everything up. After that, the
Java will work.
Nathan
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.