• 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: Best way to update relationships on fetch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to update relationships on fetch


  • Subject: Re: Best way to update relationships on fetch
  • From: Arturo PĂ©rez <email@hidden>
  • Date: Sat, 11 Oct 2003 21:09:38 -0400

On Saturday, October 11, 2003, at 06:44  PM, Ray Ackland wrote:

Sorry the title couldn't be more descriptive :)

I am working with two tables - people (who have a dob) and age groupings. The idea is to classify people into different tiers based on their age, and report on the numbers of people in each group.


My take, which may or may not suit your purposes.

You have two tables: People and AgeGroupings. Define AgeGroupings like so
DATE GroupBeginDate
DATE GroupEndDate
other necessary columns.


Then create a fetch spec along the lines of
		AgeGrouping.GroupBeginDate <= $DOB
		AND
		AgeGrouping.GroupEndDate >= $DOB.

Then in your People EO you can write a cover method like so

public NSArray relatedAgeGroups() {
NSDictionary bindings = new NSDictionary(this.valueForKey("DOB"), "DOB");
return EOUtilities.objectsWithFetchSpecificationAndBindings(this.editingContext (),
"AgeGroupings",
"relatedAgeGroupingsFetchSpec",
bindings);
}


Well, that's my spin on it. Although one of the lists participants will tell you that I overindulge
in model fetch specifications. :-)
-------
WebObjects in Philadelphia. You want a cheesesteak with that?
Visit http://webobjects.meetup.com
_______________________________________________
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.

References: 
 >Best way to update relationships on fetch (From: Ray Ackland <email@hidden>)

  • Prev by Date: RE: Announcements list (was Grumbling McCreyekes)
  • Next by Date: Re: Best way to update relationships on fetch
  • Previous by thread: Best way to update relationships on fetch
  • Next by thread: Re: Best way to update relationships on fetch
  • Index(es):
    • Date
    • Thread