• 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: EO advice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EO advice


  • Subject: Re: EO advice
  • From: John Huss <email@hidden>
  • Date: Fri, 06 Jun 2014 09:51:37 -0500


On Fri, Jun 6, 2014 at 9:43 AM, Theodore Petrosky <email@hidden> wrote:

so it seems to me that the answer is to use  awakeFromInsertion, but do the check to be sure that the global id is NOT temporary or rather, in my case put my relationship creation code in a block that first checks if the global id is temporary as I only want this to run when I create a new EO.


 @Override
  public void awakeFromInsertion(EOEditingContext ec) {
      super.awakeFromInsertion(ec);
      EOGlobalID gid = ec.globalIDForObject(this);

      

      if(gid.isTemporary()) {

        

        for (Person aPerson: Person.fetchPersons(ec, Person.IS_PRIMARY.eq(true).and(Person.CURRENT.eq(true)), null)) {
          ShowPerson.createShowPerson(ec, aPerson, this);  
        }
      }

          

  }


Which is exactly what Wonder's awakeFromInsertion does for you so you can just put your code in init.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >EO advice (From: Theodore Petrosky <email@hidden>)
 >Re: EO advice (From: Ken Anderson <email@hidden>)
 >Re: EO advice (From: Theodore Petrosky <email@hidden>)
 >Re: EO advice (From: Ken Anderson <email@hidden>)
 >Re: EO advice (From: John Huss <email@hidden>)
 >Re: EO advice (From: Ken Anderson <email@hidden>)
 >Re: EO advice (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: EO advice
  • Next by Date: any reason not to be building Utilities/NSFoundation?
  • Previous by thread: Re: EO advice
  • Next by thread: any reason not to be building Utilities/NSFoundation?
  • Index(es):
    • Date
    • Thread