• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: snapshot
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: snapshot


  • Subject: Re: snapshot
  • From: "Jonathan Fleming" <email@hidden>
  • Date: Wed, 12 Feb 2003 03:54:53 +0000

Then I get this error again:
The tbClient property of TbClientData must have a TbClient assigned

I chose:
tbClient.addObjectToBothSidesOfRelationshipWithKey(newTbClientData,
"tbClientData");
but added:
tbClientData = newTbClientData in front of the above code because the form binding are to the custom EO object tbClientData. (I suppose I should really traverse the keys tbClient.tbClientData.myAttribute)


then i wouldn't need to use the addObjectToBothSidesOfRelationshipWithKey() method if the oneToone relationship with tbClientData is propagating the primary key....






From: Art Isbell <email@hidden>
To: "Jonathan Fleming" <email@hidden>
Subject: Re: snapshot
Date: Tue, 11 Feb 2003 14:48:47 -1000

On Tuesday, February 11, 2003, at 01:21  PM, Jonathan Fleming wrote:

this was the relationship:
tbClient-(owns tbClientData, propagates primary key) > < (mandatory)-tbClientData


I was trying to do the code below before I got rid of the TbClientData code completly to find my solution:

EOEditingContext ec = session().defaultEditingContext();
TbClient newTbClient = new TbClient();
ec.insertObject(newTbClient);
session.getUser().addObjectToBothSidesOfRelationshipWithKey(newTbClient , "tbClients");
tbClient = newTbClient;


TbClientData newTbClientData = new TbClientData();
ec.insertObject(newTbClientData);
tbClientData.addObjectToBothSidesOfRelationshipWithKey(newTbClientData, "tbClient");

The above statement looks suspicious. You are adding newTbClientData to the relationship "tbClient" of an object tbClientData. The following seem more correct:


tbClient.addObjectToBothSidesOfRelationshipWithKey(newTbClientData, "tbClientData");

or equivalently

newTbClientData.addObjectToBothSidesOfRelationshipWithKey(tbClient, "tbClient");

Art
http://homepage.mac.com/aisbell/


_________________________________________________________________
MSN Messenger - fast, easy and FREE! http://messenger.msn.co.uk
_______________________________________________
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.

  • Prev by Date: Re: Information: WO 5.2 migration
  • Next by Date: Web Page does not load
  • Previous by thread: Re: snapshot
  • Next by thread: locking editing context
  • Index(es):
    • Date
    • Thread