On 18 May 2006, at 18:25, Ken Anderson wrote:
Besides calling the set method in awakeFromInsertion(), I can't imagine what else there is to do. Of course, you need to get the EO in the correct editing context. Since the EC is passed into the awakeFromInsertion() method, you could:public void awakeFromInsertion(EOEditingContext ec) {MyObject obj = EOUtilities.objectMatchingKeyandValue(ec, "ENTITY", "KEY", "VALUE");setRelObj(obj); }
One catch that I have found with this approach is that, if you create a local instance of the object in a different editing context, the related object is still in the old ec, assuming that you haven't first saved the record with the updated relationship and refaulted the objects. I don't see how this can be avoided, or even if you should attempt to avoid it.
Paul _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
