• 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
using named fetch specifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using named fetch specifications


  • Subject: using named fetch specifications
  • From: William Norris <email@hidden>
  • Date: Sun, 8 Aug 2004 18:27:26 -0500

I've gotten my named fetch spec to work correctly, but it just feels
like I've got too much java code... from reading the apple docs, it
would seem that binding a named fetch spec to input boxes like this
would automate most of it and prevent me from having to write so much
code.  see what you think...

I have an entity named "Course" that represents a college course, with
properties "dept" and "number".  I've made a named fetch specification
"Search" to use the qualifier "((dept = $courseDept) and (number =
$courseNumber))".  A display group "courseDisplayGroup" was then
created in my WOComponent, and the two queryBindings connected with
two input boxes.  my action "findCourse" contains the following code:

EOModelGroup modelGroup = EOModelGroup.defaultGroup();
EOFetchSpecification fs = modelGroup.fetchSpecificationNamed("Search",
"Course");
fs = fs.fetchSpecificationWithQualifierBindings(courseDisplayGroup.queryBindings());
NSMutableArray searchResults = new
NSMutableArray(editingContext.objectsWithFetchSpecification(fs));
course = (Course)searchResults.objectAtIndex(0);


like I said, it does work which I am happy about, but it just feels
like too much code for such a simple thing.  I feel like i'm making
three lefts turns in order to turn right.

thanks,
will
_______________________________________________
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: using named fetch specifications
      • From: Owen McKerrow <email@hidden>
    • Re: using named fetch specifications
      • From: Erik Kraft <email@hidden>
    • Re: using named fetch specifications
      • From: David Elsner <email@hidden>
  • Prev by Date: Re: return null?? [was-> Re: modify search form on result page?]
  • Next by Date: Re: Xcode 1.5 & Documentation
  • Previous by thread: Re: Xcode 1.5 & Documentation
  • Next by thread: Re: using named fetch specifications
  • Index(es):
    • Date
    • Thread