• 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: refresh an enterprise object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: refresh an enterprise object


  • Subject: Re: refresh an enterprise object
  • From: Nathan Dumar <email@hidden>
  • Date: Mon, 21 Jun 2004 19:07:17 -0400

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(a Product));


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. User EOModeler first to set everything up. After that, the Java will work.

Nathan


On Jun 21, 2004, at 10:09 AM, Goh Keng Boon wrote:

if I do a aProduct.setStatus(new Double(1)) and ec.saveChanges(), the
"1" can be saved into my database, however when i want to travel
through the relationship, i got difficulty, as it is not defined.

For example : aProduct.ps().statusdisplay()

This happened because i'm not using
"addObjectToBothSidesOfRelationshipWithKey", although data is inserted
but the relationship
is not "declared" at this time. How can i refresh my aProduct (without
a fetch spec) so that I can travel through the relationship?
_______________________________________________
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.


  • Follow-Ups:
    • Re: refresh an enterprise object
      • From: Greg Hulands <email@hidden>
References: 
 >refresh an enterprise object (From: Goh Keng Boon <email@hidden>)

  • Prev by Date: Re: Off Topic : WWDC Birds of Feather
  • Next by Date: Re: refresh an enterprise object
  • Previous by thread: refresh an enterprise object
  • Next by thread: Re: refresh an enterprise object
  • Index(es):
    • Date
    • Thread