• 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: Java Packages for Dummies
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Packages for Dummies


  • Subject: Re: Java Packages for Dummies
  • From: "Pierce T. Wetter III" <email@hidden>
  • Date: Tue, 4 Dec 2007 16:52:24 -0700


 public void setPerson(edu.uow.ris.framework.eo.Person aValue) {
       if( aValue == null ) {
           edu.uow.ris.framework.eo.Person object = person();
           if( object != null )
               removeObjectFromBothSidesOfRelationshipWithKey( object, "person" );
       } else
           addObjectToBothSidesOfRelationshipWithKey( aValue, "person" );
   }


This method should be exactly the same as the original method (other than the signature).  Adding packages changes nothing.  addObjectToBothSidesOfRelationshipWithKey will result in a call to setPerson.  In your case, setPerson then calls addObjectToBothSidesOfRelationshipWithKey which calls setPerson, which calls addObjectToBothSidesOfRelationshipWithKey etc. etc.

   public void setPerson(edu.uow.ris.framework.eo.Person value) {
       takeStoredValueForKey(value, "person");
   }


  In detail, you want to tweak your templates to look more like this:


 public void setPerson(edu.uow.ris.framework.eo.Person value) {
       takeStoredValueForKey(value, "person");
   }


 public void setPersonRelationship(edu.uow.ris.framework.eo.Person aValue) {
       if( aValue == null ) {
           edu.uow.ris.framework.eo.Person object = person();
           if( object != null )
               removeObjectFromBothSidesOfRelationshipWithKey( object, "person" );
       } else
           addObjectToBothSidesOfRelationshipWithKey( aValue, "person" );
   }

 so setPerson() sets one side, setPersonRelationship() sets both sides. 

 Pierce
 _______________________________________________
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: 
 >Java Packages for Dummies (From: Owen McKerrow <email@hidden>)
 >Re: Java Packages for Dummies (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: Java Packages for Dummies
  • Next by Date: Re: Java Packages for Dummies
  • Previous by thread: Re: Fat relationships: i.e. user <--->> transactions
  • Next by thread: Re: Java Packages for Dummies
  • Index(es):
    • Date
    • Thread