• 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: Updating EOObjects/Selecting EOObjects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating EOObjects/Selecting EOObjects


  • Subject: Re: Updating EOObjects/Selecting EOObjects
  • From: Arturo Perez <email@hidden>
  • Date: Tue, 23 Aug 2005 09:50:50 -0400

Ken Anderson wrote:
It's also important to realize that you can construct qualifiers with relationships without having to go down into the attributes (which you shouldn't even be able to do because the relationship attributes should not be class properties!). For instance, if you wanted to find all the classes that a particular teacher teaches, assuming you have teacher objects and schoolClass objects, and your schoolClass EO has a relationship called 'teacher':

EOQualifier qualifier = EOQualifier.qualifierWithQualifierFormat ("teacher = %@", new NSArray(teacherObj));

EOF knows that 'teacher' is a relationship on schoolClass, so it will use the related properties and generate a query something like this:

select class_name, blah, blah from school_class t0 where t0.teacher_id = 42

Ken


That's one of my favorite EOF features.  To expand your example a bit

EOQualifier qualifier = EOQualifier.qualifierWithQualifierFormat ("course.section.teacher= %@", new NSArray(teacherObj));

if applied to a Course kind of thing will find all the courses taught by that teacher. My SQL join foo is weak so I really appreciate the above :-)

-arturo
_______________________________________________
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


  • Follow-Ups:
    • Re: Updating EOObjects/Selecting EOObjects
      • From: Jonathan Miller <email@hidden>
References: 
 >Updating EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects (From: Chuck Hill <email@hidden>)
 >Re: Updating EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects (From: Chuck Hill <email@hidden>)
 >Re: Updating EOObjects (From: Arturo Pérez <email@hidden>)
 >Re: Updating EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects (From: Arturo Pérez <email@hidden>)
 >Re: Updating EOObjects/Selecting EOObjects (From: Jonathan Miller <email@hidden>)
 >Re: Updating EOObjects/Selecting EOObjects (From: LD <email@hidden>)
 >Re: Updating EOObjects/Selecting EOObjects (From: Ken Anderson <email@hidden>)

  • Prev by Date: Re: FileMaker, Timestamps, and SQL-92
  • Next by Date: Re: Walking an Object's Relationships
  • Previous by thread: Re: Updating EOObjects/Selecting EOObjects
  • Next by thread: Re: Updating EOObjects/Selecting EOObjects
  • Index(es):
    • Date
    • Thread